Determines whether the {@link java.lang.reflect.Field#getType() field type}
can only be represented by a property of a {@link org.apache.sling.api.resource.Resource},
not a {@link org.apache.sling.api.resource.Resource} itself.
199683
private boolean isPropertyTypeInternal() {
        Class<?> type = getType();
        return
                // References are always contained in properties of type String or String[].
                isReference()
                        || isPropertyType(type)
                        || (type.isArray() || isCollectionType) && isPropertyType(getTypeParameter());
    }
840265
public static Class<?> getGenericTypeArgument(Field field) {
        // TODO Might this better be located under SPI in an "InjectionUtil" class or something?
        Type genericType = field.getGenericType();
        if (genericType instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) genericType;
            Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
            if (actualTypeArguments.length == 1) {
                Type type = actualTypeArguments[0];
                if (type instanceof Class<?>) {
                    Class<?> realClass = (Class<?>) type;
                    return realClass;
                } else {
                    throw new IllegalArgumentException(
                        "only direct class types are allowed for generic parameter on field " + field.getName()
                                + " of type "
                                + genericType.getClass().getName() + "<T>, but " + type
                                + " was given!");
                }
            } else {
                throw new IllegalArgumentException("only one type parameter expected for field " + field.getName()
                        + " but " + actualTypeArguments.length
                        + " where found!");
            }
        } else {
            throw new IllegalArgumentException(
                "The field '" + field.getName()
                        + "' is not a ParameterizedType but this is required for type inferrence!");
        }
    }
1168264
Class<?> getGetterPropertyType( Clazz<?> clazz, String name )
	{
		String getterName = "get" + capitalizeFirstLetter( name );
		Method getter = clazz.getMethod( getterName );
		if( getter != null )
			return getter.getReturnType();

		// try direct field access
		Field field = clazz.getAllField( name );
		if( field != null )
			return field.getType();

		return null;
	}
1312721
protected Class<?> getValueType(AnnotatedElement element) {
        if (element instanceof Field) {
            return ((Field) element).getType();
        }
        if (element instanceof Method) {
            return ((Method) element).getReturnType();
        }
        throw new PropertyLoaderException("Could not get element type");
    }
624824
private static boolean areFieldsCompatible(String sourceField, TypeInformation<?> inType, String targetField,
			TypeInformation<?> outType, boolean throwException) {

		try {
			// get source type information
			TypeInformation<?> sourceType = getExpressionTypeInformation(sourceField, inType);
			// get target type information
			TypeInformation<?> targetType = getExpressionTypeInformation(targetField, outType);
			return sourceType.equals(targetType);
		} catch (InvalidFieldReferenceException e) {
			if (throwException) {
				throw e;
			} else {
				return false;
			}
		}
	}
609384
public Class<?> getGenericType(Field field) {
        Type generic = field.getGenericType();
        if (generic instanceof ParameterizedType) {
            Type actual = ((ParameterizedType) generic).getActualTypeArguments()[0];
            if (actual instanceof Class) {
                return (Class<?>) actual;
            } else if (actual instanceof ParameterizedType) {
                //in case of nested generics we don't go deep
                return (Class<?>) ((ParameterizedType) actual).getRawType();
            }
        }

        return Object.class;
    }
1304472
protected LightweightTypeReference getSarlCapacityFieldType(IResolvedTypes resolvedTypes, JvmField field) {
		// For capacity call redirection
		LightweightTypeReference fieldType = resolvedTypes.getActualType(field);
		final JvmAnnotationReference capacityAnnotation = this.annotationLookup.findAnnotation(field,
				ImportedCapacityFeature.class);
		if (capacityAnnotation != null) {
			final JvmTypeReference ref = ((JvmTypeAnnotationValue) capacityAnnotation.getValues().get(0)).getValues().get(0);
			fieldType = resolvedTypes.getActualType(ref.getType());
		}
		return fieldType;
	}
96980
public static <T extends FieldDescription> ElementMatcher.Junction<T> fieldType(Class<?> fieldType) {
        return fieldType(TypeDescription.ForLoadedType.of(fieldType));
    }
1274006
public JType getGenericType()
  {
    try {
      Type type = _field.getGenericType();

      if (type instanceof Class)
  return getType();
      else
  return new JTypeWrapper(_loader, (ParameterizedType) type);
    } catch (NoSuchMethodError e) {
      return getType();
    }
  }
871967
public static <A extends Annotation> A getAnnotation(Field field, Class<A> annotationType) {
        if (field == null || annotationType == null) {
            return null;
        }

        return field.getAnnotation(annotationType);
    }
1021025
public boolean isSameType(FieldInfo field)
    { // Copy this data to a field  //Change this to lock the objects down first!
        boolean bSameType = false;
        if (this.getClass().getName().equals(field.getClass().getName()))
            bSameType = true;
        else
        {
            Object data = this.getData();
            Class<?> classData = this.getDataClass();
            if (data != null)
                classData = data.getClass();
            Object fieldData = field.getData();
            Class<?> classField = field.getDataClass();
            if (fieldData != null)
                classField = fieldData.getClass();
            if (classData.equals(classField))
                bSameType = true;
        }
        return bSameType;
    }
536623
public static Class<?> getGenericFieldType(Field field) {
        ParameterizedType stringListType = (ParameterizedType) field.getGenericType();
        Class<?> clazz = (Class<?>) stringListType.getActualTypeArguments()[0];
        return clazz;
	}
184999
private boolean isStringProperty(EntityType entityType, Attribute attribute)
    {
        String discriminatorColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn();

        if (attribute.getName().equals(discriminatorColumn))
        {
            return true;
        }

        return attribute != null ? ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(String.class)
                || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(Character.class)
                || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(char.class)
                || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(Date.class)
                || ((AbstractAttribute) attribute).getBindableJavaType().isAssignableFrom(java.util.Date.class) : false;
    }
643087
public static <T extends FieldDescription> ElementMatcher.Junction<T> genericFieldType(TypeDescription.Generic fieldType) {
        return genericFieldType(is(fieldType));
    }
407004
public static final String getType(CmsObject cms, String rootPath) {

        String type = null;
        CmsSolrIndex index = CmsSearchManager.getIndexSolr(cms, null);
        if (index != null) {
            I_CmsSearchDocument doc = index.getDocument(CmsSearchField.FIELD_PATH, rootPath);
            if (doc != null) {
                type = doc.getFieldValueAsString(CmsSearchField.FIELD_TYPE);
            }
        }
        return type;
    }
742731
public String getResourceType() {
        if (!tokens.isEmpty() && tokens.getLast().hasKey()) {
            return tokens.getLast().getKey();
        }
        return null;
    }
195214
@Override
    public Type getType() {
        ParameterizedType type = (ParameterizedType) field.getGenericType();
        if (type.getActualTypeArguments()[0] instanceof ParameterizedType) {
            ParameterizedType first = (ParameterizedType) type.getActualTypeArguments()[0];
            return first.getRawType();
        } else {
            return type.getActualTypeArguments()[0];
        }
    }