# setPropertyValue method

1. @protected

void setPropertyValue(

1. PodHolder ph,
2. PropertyValue pv

)

Sets a property value on the pod instance using reflection.

This method handles type conversion and field assignment.

@param ph The pod holder containing instance and class @param pv The property value to set

## Implementation

    @protected
    void setPropertyValue(PodHolder ph, PropertyValue pv) {
      Field? field = ph.$2.getField(pv.getName());
      if (field != null && field.isWritable()) {
        final source = pv.getQualifiedName() != null
          ? Class.fromQualifiedName(pv.getQualifiedName()!)
          : pv.getValue()?.getClass(null, pv.getPackageName());

        if (source != null) {
          final value = convertValueIfNecessary(pv.getValue(), field.getReturnClass(), source);
          field.setValue(ph.$1, value);
        } else {
          throw PodException("No source found for property '${pv.getName()}' in class '${ph.$2.getName()}'");
        }
      }
    }