クラスから、指定したフィールド情報を取得します。
@param targetClass フィールドが定義されているクラス
@param propertyName プロパティ名
@param propertyType プロパティタイプ
@return 存在しない場合、空を返します。
973308
public static Optional<Field> extractField(final Class<?> targetClass, final String propertyName, final Class<?> propertyType) {
        
        final Field field;
        try {
            field = targetClass.getDeclaredField(propertyName);
        } catch (NoSuchFieldException | SecurityException e) {
            return Optional.empty();
        }
        
        field.setAccessible(true);
        
        if(!field.getType().equals(propertyType)) {
            return Optional.empty();
            
        }
        
        return Optional.of(field);
        
    }
64481
public function setCustomProperty($propertyName,$propertyValue='',$propertyType=NULL) {
        if (($propertyType === NULL) || (!in_array($propertyType,array(self::PROPERTY_TYPE_INTEGER,
                                                                       self::PROPERTY_TYPE_FLOAT,
                                                                       self::PROPERTY_TYPE_STRING,
                                                                       self::PROPERTY_TYPE_DATE,
                                                                       self::PROPERTY_TYPE_BOOLEAN)))) {
            if ($propertyValue === NULL) {
                $propertyType = self::PROPERTY_TYPE_STRING;
            } elseif (is_float($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_FLOAT;
            } elseif(is_int($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_INTEGER;
            } elseif (is_bool($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
            } else {
                $propertyType = self::PROPERTY_TYPE_STRING;
            }
        }

        $this->_customProperties[$propertyName] = array('value' => $propertyValue, 'type' => $propertyType);
        return $this;
    }
1267772
static Set<Method> getSetters(Class<?> targetClass, String propertyName) {
		String setterName = setterName(propertyName);
		Set<Method> setters = new HashSet<>();

		while (targetClass != null) {
			for (Method method : targetClass.getDeclaredMethods()) {
				if (method.getName().equals(setterName) && method.getParameterTypes().length == 1) {
					logger.debug("Found setter {} in class {}", method, targetClass);
					setters.add(method);
				}
			}
			targetClass = targetClass.getSuperclass();
		}

		return setters;
	}
392208
public static void mapping(String mappedFieldName,Class<?> mappedClass, Class<?> targetClass){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException2,mappedFieldName,mappedClass.getSimpleName(),targetClass.getSimpleName()));
	}
482388
public <T> T getStaticPropertyValue(String propName, Class<T> type) {
        return ClassPropertyFetcher.getStaticPropertyValue(getClazz(), propName, type);
    }
497756
public <T> T getSetting(final String key, final Class<T> targetType) {
        return environment.getProperty(this.propertyPrefix + '.' + key, targetType);
    }
1091295
public void setPropertyElementType (Class type, String propertyName, Class elementType) {
		if (type == null) throw new IllegalArgumentException("type cannot be null.");
		if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
		if (elementType == null) throw new IllegalArgumentException("propertyType cannot be null.");
		Property property = Beans.getProperty(type, propertyName, beanProperties, privateFields, this);
		if (property == null)
			throw new IllegalArgumentException("The class " + type.getName() + " does not have a property named: " + propertyName);
		if (!Collection.class.isAssignableFrom(property.getType()) && !Map.class.isAssignableFrom(property.getType())) {
			throw new IllegalArgumentException("The '" + propertyName + "' property on the " + type.getName()
				+ " class must be a Collection or Map: " + property.getType());
		}
		propertyToElementType.put(property, elementType);
	}
986900
public static boolean isPropertyGettable(
                    final Class<?> clazz,
                    final String propertyName
                    )
    {
        if (clazz == null) {
            throw new IllegalArgumentException( "no class specified" );
        }

        if (propertyName == null) {
            throw new IllegalArgumentException( "no property specified" );
        }

        PropertyAccessor  accessor = _findAccessor( clazz, propertyName );

        return (accessor == null ? false : accessor.isGettable());
    }
506781
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "target")
    public JAXBElement<TargetPropertyType> createTarget(TargetPropertyType value) {
        return new JAXBElement<TargetPropertyType>(_Target_QNAME, TargetPropertyType.class, null, value);
    }
536363
private static String getSubType(Class type, String propertyName) {
		@SuppressWarnings("unchecked")
		Class normalizedType = SimonTypeFactory.normalizeType(type);
		if (normalizedType == null) {
			return null;
		} else {
			return subTypeProperties.getProperty(normalizedType.getName() + "." + propertyName);
		}
	}
980007
public static String getGetterName(String propertyName, Class type) {
        String prefix = type == boolean.class || type == Boolean.class ? "is" : "get";
        return prefix + MetaClassHelper.capitalize(propertyName);
    }
1033515
@SuppressWarnings("unchecked")
	private <T> T getPropertyAs(String propertyName, Class<T> propertyType) {
		final String sValue = properties == null ? null : properties.getProperty(propertyName);
		final T value;
		if (sValue == null) {
			value = null;
		} else if (propertyType.equals(String.class)) {
			value = propertyType.cast(sValue);
		} else if (propertyType.equals(Integer.class)) {
			value = propertyType.cast(Integer.valueOf(sValue));
		} else if (propertyType.equals(int.class)) {
			value = (T) Integer.valueOf(sValue);
		} else if (propertyType.equals(Long.class)) {
			value = propertyType.cast(Long.valueOf(sValue));
		} else if (propertyType.equals(long.class)) {
			value = (T) Long.valueOf(sValue);
		} else if (propertyType.equals(Boolean.class)) {
			value = propertyType.cast(Boolean.valueOf(sValue));
		} else if (propertyType.equals(boolean.class)) {
			value = (T) Boolean.valueOf(sValue);
		} else {
			value = null;
		}
		return value;
	}
451104
public static boolean isPropertyOfType(Class<?> clazz, String propertyName, Class<?> type) {
        try {
            Class<?> propType = getPropertyType(clazz, propertyName);
            return propType != null && propType.equals(type);
        }
        catch (Exception e) {
            return false;
        }
    }
1145191
public Type getPropertyType(String propertyName) {
    Type type = (Type) propertyTypes.get(propertyName);
    if (null == type) {
      Class<?> propertyType = PropertyUtils.getPropertyType(componentClass, propertyName);
      if (null != propertyType) { return new IdentifierType(propertyType); }
    }
    return type;
  }
1062636
private static PropertyDescriptor getPropertyDescriptor( final Class<?> type, final String propertyName ) {

        Exceptions.requireNonNull(type);
        Exceptions.requireNonNull(propertyName);

        if ( !propertyName.contains( "." ) ) {
            return doGetPropertyDescriptor( type, propertyName );
        } else {
            String[] propertyNames = propertyName.split( "[.]" );
            Class<?> clazz = type;
            PropertyDescriptor propertyDescriptor = null;
            for ( String pName : propertyNames ) {
                propertyDescriptor = doGetPropertyDescriptor( clazz, pName );
                if ( propertyDescriptor == null ) {
                    return null;
                }
                clazz = propertyDescriptor.getPropertyType();
            }
            return propertyDescriptor;
        }
    }
1049174
public static void setProperty(Object target, String property, Object value) {
    try {
      InvokerHelper.setProperty(target, property, value);
    } catch (InvokerInvocationException e) {
      ExceptionUtil.sneakyThrow(e.getCause());
    }
  }
25135
public function getTypeOfChildProperty($targetType, $propertyName, PropertyMappingConfigurationInterface $configuration) {
		$typeDeclaration = \TYPO3\Flow\Utility\TypeHandling::parseType($targetType);
		if ($typeDeclaration['elementType'] !== NULL) {
			return $typeDeclaration['elementType'];
		}

		$configuredTargetType = $configuration->getConfigurationFor($propertyName)->getConfigurationValue('TYPO3\Flow\Property\TypeConverter\ObjectConverter', self::CONFIGURATION_TARGET_TYPE);
		if ($configuredTargetType !== NULL) {
			return $configuredTargetType;
		}

		$methodParameters = $this->reflectionService->getMethodParameters($targetType, '__construct');
		if (isset($methodParameters[$propertyName]) && isset($methodParameters[$propertyName]['type'])) {
			return $methodParameters[$propertyName]['type'];
		} elseif ($this->reflectionService->hasMethod($targetType, ObjectAccess::buildSetterMethodName($propertyName))) {
			$methodParameters = $this->reflectionService->getMethodParameters($targetType, ObjectAccess::buildSetterMethodName($propertyName));
			$methodParameter = current($methodParameters);
			if (isset($methodParameter['type'])) {
				return $methodParameter['type'];
			}
		} else {
			$targetPropertyNames = $this->reflectionService->getClassPropertyNames($targetType);
			if (in_array($propertyName, $targetPropertyNames)) {
				$values = $this->reflectionService->getPropertyTagValues($targetType, $propertyName, 'var');
				if (count($values) > 0) {
					return current($values);
				}
			}
		}

		return 'string';
	}