Wire {@link PropertyBasedConfigurator.Param @Param}-annotated fields.

@param object Object whose fields are to be wired.
493561
public void wireParams(Object object) {
        Class<?> clazz = object.getClass();

        while (clazz != Object.class) {
            for (Field field : clazz.getDeclaredFields()) {
                field.setAccessible(true);
                Param annot = field.getAnnotation(Param.class);

                if (annot != null) {
                    String propName = expandPropertyName(annot.property());
                    String value = propertyProvider.getProperty(propName);
                    
                    if (value == null || value.isEmpty()) {
                        value = annot.defaultValue();
                        value = NULL_VALUE.equals(value) ? null : value;
                    }
                    
                    if (value == null) {
                        if (annot.required()) {
                            throw new RuntimeException("Required configuration property not specified: " + propName);
                        } else {
                            continue;
                        }
                    }

                    try {
                        field.set(object, conversionService.convert(value, field.getType()));
                    } catch (Exception e) {
                        throw MiscUtil.toUnchecked(e);
                    }
                }
            }

            clazz = clazz.getSuperclass();
        }
    }
1364526
protected final void buildCommonPropertyParameters( CodeBlock.Builder paramBuilder, PropertyInfo property ) {
        if ( property.getFormat().isPresent() ) {
            JsonFormat format = property.getFormat().get();

            if ( !Strings.isNullOrEmpty( format.pattern() ) ) {
                paramBuilder.add( "\n.setPattern($S)", format.pattern() );
            }

            paramBuilder.add( "\n.setShape($T.$L)", Shape.class, format.shape().name() );

            if ( !Strings.isNullOrEmpty( format.locale() ) && !JsonFormat.DEFAULT_LOCALE.equals( format.locale() ) ) {
                logger.log( Type.WARN, "JsonFormat.locale is not supported by default" );
                paramBuilder.add( "\n.setLocale($S)", format.locale() );
            }
        }

        if ( property.getIgnoredProperties().isPresent() ) {
            for ( String ignoredProperty : property.getIgnoredProperties().get() ) {
                paramBuilder.add( "\n.addIgnoredProperty($S)", ignoredProperty );
            }
        }
    }
824586
public static void setPropertyValue(StructuralProperty property, Object object, Object value) {
        Field field = property.getJavaField();
        field.setAccessible(true);
        try {
            field.set(object, value);
        } catch (IllegalAccessException e) {
            throw new ODataSystemException("Cannot write property: " + property + " of object: " + object, e);
        }
    }
236112
public static Map<String, Object> configureObjectFieldsWithProperties(
            final Object object,
            final List<Property> properties,
            final Map<String, Object> inputConfig
    )
    {
        HashMap<String, Object> modified = new HashMap<>(inputConfig);
        for (final Property property : properties) {
            if (null != modified.get(property.getName())) {
                if (setValueForProperty(property, modified.get(property.getName()), object)) {
                    modified.remove(property.getName());
                }
            }
        }
        return modified;
    }
481661
public void setPropertyValue(final JsiiObjectRef objRef, final String property, final JsonNode value) {
        ObjectNode req = makeRequest("set", objRef);
        req.put("property", property);
        req.set("value", value);

        this.runtime.requestResponse(req);
    }
583897
public static Map<String, Object> configureObjectFieldsWithProperties(
            final Object object,
            final Map<String, Object> inputConfig
    )
    {
        return configureObjectFieldsWithProperties(object, buildFieldProperties(object), inputConfig);
    }
1249677
protected void extractPropertyDescriptor(Field field, Object defaultInstance)
    {
        DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor();

        // is parameter hidden
        PropertyHidden parameterHidden = field.getAnnotation(PropertyHidden.class);

        if (parameterHidden == null) {
            // get parameter id
            PropertyId propertyId = field.getAnnotation(PropertyId.class);
            desc.setId(propertyId != null ? propertyId.value() : field.getName());

            // set parameter type
            desc.setPropertyType(field.getGenericType());

            // get parameter name
            PropertyName parameterName = field.getAnnotation(PropertyName.class);

            desc.setName(parameterName != null ? parameterName.value() : desc.getId());

            // get parameter description
            PropertyDescription parameterDescription = field.getAnnotation(PropertyDescription.class);

            desc.setDescription(parameterDescription != null ? parameterDescription.value() : desc.getId());

            Map<Class, Annotation> annotations = new HashMap<>();
            COMMON_ANNOTATION_CLASSES.forEach(aClass ->
                    annotations.put(aClass, field.getAnnotation(aClass))
            );

            setCommonProperties(desc, annotations);

            if (defaultInstance != null) {
                // get default value
                try {
                    desc.setDefaultValue(field.get(defaultInstance));
                } catch (Exception e) {
                    LOGGER.error(
                            MessageFormat.format("Failed to get default property value from field {0} in class {1}",
                                    field.getName(), this.beanClass), e);
                }
            }

            desc.setField(field);

            this.parameterDescriptorMap.put(desc.getId(), desc);
        }
    }
1035227
public DataBinder put(Object object) throws Exception {
        for (Field field: Beans.getKnownInstanceFields(object.getClass())) {
            Object value = field.get(object);
            if (value != null) {
                put(field.getName(), value.toString());
            }
        }
        return this;
    }
274933
private void addJavaFXPropertyToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) {
        for (PropertyNode propertyNode : classNode.getProperties()) {
            FieldNode field = propertyNode.getField();
            // look to see if per-field handlers will catch this one...
            if (hasFXBindableAnnotation(field)
                || ((field.getModifiers() & Modifier.FINAL) != 0)
                || field.isStatic()) {
                // explicitly labeled properties are already handled,
                // don't transform final properties
                // don't transform static properties
                continue;
            }
            createPropertyGetterSetter(classNode, propertyNode);
        }
    }
542500
private static void setValue(Object obj, String propertyPattern, Object value, ObjectWrapper options) {
        if (propertyPattern == null) {
            throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyPattern.");
        }

        if (obj == null) {
            // NullPointerException as it is throwed only when traversing a null object (ex: "foo.null.bar")
            throw new NullPointerException("Cannot set the value of '" + propertyPattern + "' to a 'null' object.");
        }

        // '.' position if positive, '[' inverse position if negative
        int position = indexOfDotOrSquare(propertyPattern);

        // (propertyPattern.contains("."))
        if (position > 0) {
            String leftPattern = propertyPattern.substring(0, position);
            String rightPattern = propertyPattern.substring(position + 1, propertyPattern.length());
            Object leftValue = getValue(obj, leftPattern, options);

            if (leftValue == null) {
                Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

                if (options.isAutoInstancing) {
                    try {
                        leftValue = leftProperty.getType().newInstance();
                    } catch (Exception e) {
                        throw new ReflectionException("The value of " + leftProperty + " was 'null' in the object "
                                                              + obj.getClass().getName() + ". An attempt to invoke its 'no-args constructor'" +
                                                              " was made, but an error occurs.", e);
                    }

                    leftProperty.set(obj, leftValue);
                }
            }

            setValue(leftValue, rightPattern, value, options);
            // if (propertyPattern.contains("["))
        } else if (position < 0) {
            int squarePosition = -position;

            String leftPattern = propertyPattern.substring(0, squarePosition);
            String indexOrKey = propertyPattern.substring(squarePosition + 1, propertyPattern.length() - 1);// removes ']'
            Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

            if (leftProperty.getType().isAssignableFrom(Map.class)) {
                setMappedValue(obj, leftProperty, indexOrKey, value, options);
            } else {
                try {
                    setIndexedValue(obj, leftProperty, Integer.parseInt(indexOrKey), value, options);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("The pattern '" + indexOrKey + "' for the indexed "
                                                               + leftProperty + " is invalid. Cannot parse the string to a valid integer index.");
                }
            }
        } else {
            setSimpleValue(obj, getPropertyOrThrow(Bean.forClass(obj.getClass()), propertyPattern), value);
        }
    }
109727
public static void putProperty(Scriptable obj, Symbol key, Object value)
    {
        Scriptable base = getBase(obj, key);
        if (base == null)
            base = obj;
        ensureSymbolScriptable(base).put(key, obj, value);
    }
1031582
@Override
  public final String reconfigureProperty(String property, String newVal)
    throws ReconfigurationException {
    if (isPropertyReconfigurable(property)) {
      String oldVal;
      synchronized(getConf()) {
        oldVal = getConf().get(property);
        reconfigurePropertyImpl(property, newVal);
        if (newVal != null) {
          getConf().set(property, newVal);
        } else {
          getConf().unset(property);
        }
      }
      return oldVal;
    } else {
      throw new ReconfigurationException(property, newVal,
                                             getConf().get(property));
    }
  }
730579
private void parseProperties(Element element, BeanDefinitionBuilder builder,
                                 ManagedList<AbstractBeanDefinition> propertyList) {
        NodeList properties = element.getChildNodes();

        for (int i = 0; i < properties.getLength(); i++) {
            Node node = properties.item(i);

            if (!(node instanceof Element)) {
                continue;
            }

            Element property = (Element) node;
            BeanDefinitionBuilder propertyBuilder = BeanDefinitionBuilder.genericBeanDefinition(PropertyInfo.class);
            addProperties(property, propertyBuilder);
            parseConfig(property, propertyBuilder);
            propertyList.add(propertyBuilder.getBeanDefinition());
        }
    }
942305
@Override
    public void setValueFromObject(Object anObject) {
        if ((anObject!=null) && (value==null)) {
            if(anObject instanceof QualifiedName) {
                setValue((QualifiedName)anObject);
            } else if (anObject instanceof org.openprovenance.prov.model.LangString) { 
                setValue((org.openprovenance.prov.model.LangString)anObject);
            } else if (anObject instanceof byte[]) {
                setValueFromObject((byte[]) anObject);
            } else if (anObject instanceof org.w3c.dom.Node) {
                setValueFromObject((org.w3c.dom.Node)anObject);
            } else {
                setValue(anObject.toString());
            }
        }
1327629
public static void setProperty2(Object newValue, Object object, String property) {
        setProperty(object, property, newValue);
    }
100419
function baseAssignValue(object, key, value) {
  if (key == '__proto__' && defineProperty$1) {
    defineProperty$1(object, key, {
      'configurable': true,
      'enumerable': true,
      'value': value,
      'writable': true
    });
  } else {
    object[key] = value;
  }
}
940636
public void setConfiguration( Dictionary<?,?> properties ) {

		// Ignore iPojo properties
		final List<String> propertiesToSkip = Arrays.asList(
				"component",
				"felix.fileinstall.filename" );

		// Convert the dictionary into a map
		Map<String,String> map = new LinkedHashMap<> ();
		for( Enumeration<?> en = properties.keys(); en.hasMoreElements(); ) {

			Object key = en.nextElement();
			String keyAsString = String.valueOf( key );
			if( propertiesToSkip.contains( keyAsString ))
				continue;

			// "null" are not acceptable values in dictionaries
			// (OSGi often use Hash tables)
			Object value = properties.get( key );
			map.put( keyAsString, String.valueOf( value ));
		}

		// Invoked by iPojo => the messaging type is the right one in this method
		map.put( MessagingConstants.MESSAGING_TYPE_PROPERTY, FACTORY_RABBITMQ );
		setConfiguration( map );
	}