Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata.accessors.objects

public Class MetadataAnnotatedElement

extends MetadataAccessibleObject
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataClass, org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField, org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataMethod
Static Imports
org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.ECLIPSELINK_OXM_PACKAGE_PREFIX, .MetadataConstants.JPA_ACCESS, .MetadataConstants.JPA_BASIC, .MetadataConstants.JPA_ELEMENT_COLLECTION, .MetadataConstants.JPA_EMBEDDABLE, .MetadataConstants.JPA_EMBEDDED, .MetadataConstants.JPA_EMBEDDED_ID, .MetadataConstants.JPA_ENUMERATED, .MetadataConstants.JPA_ID, .MetadataConstants.JPA_LOB, .MetadataConstants.JPA_MANY_TO_MANY, .MetadataConstants.JPA_MANY_TO_ONE, .MetadataConstants.JPA_ONE_TO_MANY, .MetadataConstants.JPA_ONE_TO_ONE, .MetadataConstants.JPA_TEMPORAL, .MetadataConstants.JPA_VERSION

INTERNAL: Parent object that is used to hold onto a valid JPA decorated method, field or class.
Author
Guy Pelletier
Since
EclipseLink 1.0

Field Summary

Modifier and TypeField and Description
public static final String
private Map<String, MetadataAnnotation>
m_annotations

Stores any annotations defined for the element, keyed by annotation name.

private String
m_attributeName

Defines the attribute name of a field, or property name of a method.

private List<String>
m_genericType

Defines the generic types of the elements type.

private final Map<String, MetadataAnnotation>
m_metaAnnotations

Stores any meta-annotations defined for the element, keyed by meta-annotation name.

private int
m_modifiers

Defines elements modifiers, i.e. private/static/transient.

private String
m_name

The name of the element, i.e. class name, field name, method name.

pack-priv Object
m_primitiveType

Used with the APT processor.

private MetadataClass
m_rawClass

Used to cache the type metadata class, but cannot be cached in the case of generics.

private MetadataClass
m_rawClassWithGenerics

Used to cache the full type metadata class including some generic specifications.

private String
m_type

Defines the field type, or method return type class name.

Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject:
m_factory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addAnnotation(MetadataAnnotation annotation)

INTERNAL:

public void
addGenericType(String genericType)

INTERNAL:

public void
public boolean
areAnnotationsCompatibleWithTransient(ClassAccessor classAccessor)

INTERNAL: Return true if this accessible object has 2 or more declared persistence annotations.

public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

INTERNAL:
public MetadataAnnotation
getAnnotation(Class<?> annotation)

INTERNAL: Return the annotated element for this accessor.

public MetadataAnnotation
getAnnotation(final String
annotation name
annotation
)

INTERNAL: Return the annotated element for this accessor.

protected final MetadataAnnotation
getAnnotation(final String
annotation name
annotation
,
final Set<String>
meta-annotations names cycle detection set, shall not be null
names
)

INTERNAL: Return the annotated element for this accessor.

public MetadataAnnotation
getAnnotation(String annotationClassName, ClassAccessor classAccessor)

INTERNAL: Return the annotated element for this accessor.

public Map<String, MetadataAnnotation>

Returns:

annotations defined for the element, keyed by annotation name. Never returns null.
getAnnotations
()

INTERNAL: Return the annotations of this accessible object.

public String
protected int
public List<String>
getGenericType()

INTERNAL:

public MetadataClass
getMapKeyClass(MetadataDescriptor descriptor)

INTERNAL: This should only be called for accessor's of type Map.

public int
getModifiers()

INTERNAL:

public String
public Object
getPrimitiveType()

INTERNAL: If this annotated element was built from java model elements and is a primitive type, this primitive type will be set.

public MetadataClass
getRawClass(MetadataDescriptor descriptor)

INTERNAL: Return the raw class for this accessible object.

public MetadataClass
getRawClassWithGenerics(MetadataDescriptor descriptor)

INTERNAL: Return the complete raw class with generics for this accessible object.

public MetadataClass
getReferenceClassFromGeneric(MetadataDescriptor descriptor)

INTERNAL: Return the reference class from the generic specification on this accessible object.

public String
getType()

INTERNAL:

public boolean
hasDeclaredAnnotations(ClassAccessor classAccessor)

INTERNAL: Return true if this accessible object has 1 or more declared persistence annotations.

public int
hashCode()

Overrides java.lang.Object.hashCode.

INTERNAL:
public boolean
isAnnotationNotPresent(Class<?> annotation, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object.

public boolean
isAnnotationNotPresent(String annotation, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object.

public boolean
isAnnotationPresent(Class<?> annotationClass, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata.

public boolean
isAnnotationPresent(String annotation)

INTERNAL: Indicates whether the specified annotation is present on this accessible object.

public boolean
isAnnotationPresent(String annotationName, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata.

public boolean
isArray(ClassAccessor classAccessor)

INTERNAL: Return true if this field accessor represents an array relationship.

public boolean
isBasic(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a basic mapping.

public boolean
isBasicCollection(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a basic collection mapping.

public boolean
isBasicMap(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a basic collection mapping.

public boolean
isDerivedId(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an id mapping.

public boolean
isDerivedIdClass(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an id mapping.

public boolean
isElementCollection(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an element collection mapping.

public boolean
isEmbedded(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an aggregate mapping.

public boolean
isEmbeddedId(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an aggregate id mapping.

public boolean
isGenericCollectionType()

INTERNAL: Method to return whether a collection type is a generic.

public boolean
isGenericType()

INTERNAL: Method to return whether a type is a generic.

public boolean
isId(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an id mapping.

public boolean
isManyToMany(ClassAccessor classAccessor)

INTERNAL: Return true if this field accessor represents a m-m relationship.

public boolean
isManyToOne(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a m-1 relationship.

public boolean
isOneToMany(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a 1-m relationship.

public boolean
isOneToOne(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a 1-1 relationship.

public boolean
isStructure(ClassAccessor classAccessor)

INTERNAL: Return true if this field accessor represents a structure relationship.

public boolean
isSupportedCollectionClass(MetadataClass metadataClass)

INTERNAL: Method to return whether the given class is a supported collection class.

public boolean
isSupportedMapClass(MetadataClass metadataClass)

INTERNAL: Method to return whether the given class is a supported map class.

public boolean
isSupportedToManyCollectionClass(MetadataClass metadataClass)

INTERNAL: Method to return whether the given class is a supported to many collection class.

public boolean
isTransformation(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an transformation mapping.

protected boolean
isValidPersistenceElement(boolean mustBeExplicit, String explicitType, ClassAccessor classAccessor)

INTERNAL: When processing the inverse accessors to an explicit access setting, their must be an Access(FIELD) or Access(PROPERTY) present for the element to be processed.

protected boolean
isValidPersistenceElement(int modifiers)

INTERNAL: Return true if the modifiers are not transient, static or abstract.

public boolean
isVariableOneToOne(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a variable 1-1 relationship.

public boolean
isVersion(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a version mapping.

public void
setAnnotations(Map<String, MetadataAnnotation> annotations)

INTERNAL: Set the annotations of this accessible object.

public void
setAttributeName(String attributeName)

INTERNAL:

public void
setGenericType(List<String> genericType)

INTERNAL:

public void
setModifiers(int modifiers)

INTERNAL:

public void
setName(String name)

INTERNAL:

public void
setPrimitiveType(Object primitiveType)

INTERNAL: If this annotated element was built from java model elements and is a primitive type this method will be called.

public void
setType(String type)

INTERNAL:

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL:
Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject:
getLoggergetMetadataClassgetMetadataFactorysetMetadataFactory

Field Detail

DEFAULT_RAW_CLASSback to summary
public static final String DEFAULT_RAW_CLASS
m_annotationsback to summary
private Map<String, MetadataAnnotation> m_annotations

Stores any annotations defined for the element, keyed by annotation name.

m_attributeNameback to summary
private String m_attributeName

Defines the attribute name of a field, or property name of a method.

m_genericTypeback to summary
private List<String> m_genericType

Defines the generic types of the elements type. This is null if no generics are used. This is a list of class/type names from the class/field/method signature. The size of the list varies depending on how many generics are present, i.e. - Map<String, Long> -> ["java.util.Map", "java.lang.String", "java.lang.Long"] - Beverage<T> extends Object -> [T, :, java.lang.Object, java.lang.Object]

m_metaAnnotationsback to summary
private final Map<String, MetadataAnnotation> m_metaAnnotations

Stores any meta-annotations defined for the element, keyed by meta-annotation name.

m_modifiersback to summary
private int m_modifiers

Defines elements modifiers, i.e. private/static/transient.

m_nameback to summary
private String m_name

The name of the element, i.e. class name, field name, method name.

m_primitiveTypeback to summary
pack-priv Object m_primitiveType

Used with the APT processor. Stores the PrimitiveType if this annotated element is a primitive. We can't make it a primitive type here because it introduces a JDK 1.6 dependency. The APT processor will need to cast it back.

m_rawClassback to summary
private MetadataClass m_rawClass

Used to cache the type metadata class, but cannot be cached in the case of generics.

m_rawClassWithGenericsback to summary
private MetadataClass m_rawClassWithGenerics

Used to cache the full type metadata class including some generic specifications.

m_typeback to summary
private String m_type

Defines the field type, or method return type class name.

Constructor Detail

MetadataAnnotatedElementback to summary
public MetadataAnnotatedElement(MetadataFactory factory)

INTERNAL:

Method Detail

addAnnotationback to summary
public void addAnnotation(MetadataAnnotation annotation)

INTERNAL:

addGenericTypeback to summary
public void addGenericType(String genericType)

INTERNAL:

addMetaAnnotationback to summary
public void addMetaAnnotation(MetadataAnnotation annotation)

INTERNAL:

areAnnotationsCompatibleWithTransientback to summary
public boolean areAnnotationsCompatibleWithTransient(ClassAccessor classAccessor)

INTERNAL: Return true if this accessible object has 2 or more declared persistence annotations.

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

INTERNAL:

Parameters
object:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAnnotationback to summary
public MetadataAnnotation getAnnotation(Class<?> annotation)

INTERNAL: Return the annotated element for this accessor.

Note

This method does not check against a metadata complete.

getAnnotationback to summary
public MetadataAnnotation getAnnotation(final String annotation)

INTERNAL: Return the annotated element for this accessor.

Note

This method does not check against a meta-data complete.

Parameters
annotation:String

annotation name

getAnnotationback to summary
protected final MetadataAnnotation getAnnotation(final String annotation, final Set<String> names)

INTERNAL: Return the annotated element for this accessor.

Note

This method does not check against a meta-data complete.

Parameters
annotation:String

annotation name

names:Set<String>

meta-annotations names cycle detection set, shall not be null

getAnnotationback to summary
public MetadataAnnotation getAnnotation(String annotationClassName, ClassAccessor classAccessor)

INTERNAL: Return the annotated element for this accessor.

getAnnotationsback to summary
public Map<String, MetadataAnnotation> getAnnotations()

INTERNAL: Return the annotations of this accessible object.

Returns:Map<String, MetadataAnnotation>

annotations defined for the element, keyed by annotation name. Never returns null.

getAttributeNameback to summary
public String getAttributeName()

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject.getAttributeName.

INTERNAL:

Annotations
@Override
getDeclaredAnnotationsCountback to summary
protected int getDeclaredAnnotationsCount(ClassAccessor classAccessor)

INTERNAL:

getGenericTypeback to summary
public List<String> getGenericType()

INTERNAL:

getMapKeyClassback to summary
public MetadataClass getMapKeyClass(MetadataDescriptor descriptor)

INTERNAL: This should only be called for accessor's of type Map. It will return the map key type if generics are used, null otherwise.

getModifiersback to summary
public int getModifiers()

INTERNAL:

getNameback to summary
public String getName()

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject.getName.

INTERNAL:

Annotations
@Override
getPrimitiveTypeback to summary
public Object getPrimitiveType()

INTERNAL: If this annotated element was built from java model elements and is a primitive type, this primitive type will be set.

getRawClassback to summary
public MetadataClass getRawClass(MetadataDescriptor descriptor)

INTERNAL: Return the raw class for this accessible object. E.g. For an accessible object with a type of java.util.Collection<Employee>, this method will return java.util.Collection.

See Also
to get Employee.class back., to get java.util.CollectionEmployee back.
getRawClassWithGenericsback to summary
public MetadataClass getRawClassWithGenerics(MetadataDescriptor descriptor)

INTERNAL: Return the complete raw class with generics for this accessible object. E.g. For an accessible object with a type of java.util.Collection<Employee>, this method will return java.util.CollectionEmployee. Note, the generics are appended to the name of the class.

See Also
to get Employee.class back., to get java.util.Collection back.
getReferenceClassFromGenericback to summary
public MetadataClass getReferenceClassFromGeneric(MetadataDescriptor descriptor)

INTERNAL: Return the reference class from the generic specification on this accessible object. Here is what you will get back from this method given the following scenarios: 1 - public Collection<String> getTasks() => String.class 2 - public Map<String, Integer> getTasks() => Integer.class 3 - public Employee getEmployee() => null 4 - public Collection getTasks() => null 5 - public Map getTasks() => null 6 - public Collection<byte[]> getAudio() => byte[].class 7 - public Map<X,Y> on a MappedSuperclass where Y is defined in the Entity superclass<T> => Void.class (in all bug 266912 cases)

getTypeback to summary
public String getType()

INTERNAL:

hasDeclaredAnnotationsback to summary
public boolean hasDeclaredAnnotations(ClassAccessor classAccessor)

INTERNAL: Return true if this accessible object has 1 or more declared persistence annotations.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

INTERNAL:

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
isAnnotationNotPresentback to summary
public boolean isAnnotationNotPresent(Class<?> annotation, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object. Used for defaulting. Need this check since the isAnnotationPresent calls can return a false when true because of the meta-data complete feature.

isAnnotationNotPresentback to summary
public boolean isAnnotationNotPresent(String annotation, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object. Used for defaulting. Need this check since the isAnnotationPresent calls can return a false when true because of the meta-data complete feature.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(Class<?> annotationClass, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(String annotation)

INTERNAL: Indicates whether the specified annotation is present on this accessible object.

Note

Calling this method directly does not take any metadata complete flag into consideration. Look at the other isAnnotationPresent methods that takes a class accessor.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(String annotationName, ClassAccessor accessor)

INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata.

isArrayback to summary
public boolean isArray(ClassAccessor classAccessor)

INTERNAL: Return true if this field accessor represents an array relationship.

isBasicback to summary
public boolean isBasic(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a basic mapping.

isBasicCollectionback to summary
public boolean isBasicCollection(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a basic collection mapping.

Annotations
@SuppressWarnings:deprecation
isBasicMapback to summary
public boolean isBasicMap(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a basic collection mapping.

Annotations
@SuppressWarnings:deprecation
isDerivedIdback to summary
public boolean isDerivedId(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an id mapping.

isDerivedIdClassback to summary
public boolean isDerivedIdClass(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an id mapping.

isElementCollectionback to summary
public boolean isElementCollection(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an element collection mapping.

isEmbeddedback to summary
public boolean isEmbedded(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an aggregate mapping. True is returned if an Embedded annotation is found or if an Embeddable annotation is found on the raw/reference class.

isEmbeddedIdback to summary
public boolean isEmbeddedId(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an aggregate id mapping.

isGenericCollectionTypeback to summary
public boolean isGenericCollectionType()

INTERNAL: Method to return whether a collection type is a generic.

isGenericTypeback to summary
public boolean isGenericType()

INTERNAL: Method to return whether a type is a generic.

isIdback to summary
public boolean isId(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an id mapping.

isManyToManyback to summary
public boolean isManyToMany(ClassAccessor classAccessor)

INTERNAL: Return true if this field accessor represents a m-m relationship.

isManyToOneback to summary
public boolean isManyToOne(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a m-1 relationship.

isOneToManyback to summary
public boolean isOneToMany(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a 1-m relationship.

isOneToOneback to summary
public boolean isOneToOne(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a 1-1 relationship.

isStructureback to summary
public boolean isStructure(ClassAccessor classAccessor)

INTERNAL: Return true if this field accessor represents a structure relationship.

isSupportedCollectionClassback to summary
public boolean isSupportedCollectionClass(MetadataClass metadataClass)

INTERNAL: Method to return whether the given class is a supported collection class.

isSupportedMapClassback to summary
public boolean isSupportedMapClass(MetadataClass metadataClass)

INTERNAL: Method to return whether the given class is a supported map class.

isSupportedToManyCollectionClassback to summary
public boolean isSupportedToManyCollectionClass(MetadataClass metadataClass)

INTERNAL: Method to return whether the given class is a supported to many collection class.

isTransformationback to summary
public boolean isTransformation(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents an transformation mapping.

isValidPersistenceElementback to summary
protected boolean isValidPersistenceElement(boolean mustBeExplicit, String explicitType, ClassAccessor classAccessor)

INTERNAL: When processing the inverse accessors to an explicit access setting, their must be an Access(FIELD) or Access(PROPERTY) present for the element to be processed. Otherwise, it is ignored.

isValidPersistenceElementback to summary
protected boolean isValidPersistenceElement(int modifiers)

INTERNAL: Return true if the modifiers are not transient, static or abstract.

isVariableOneToOneback to summary
public boolean isVariableOneToOne(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a variable 1-1 relationship. The method will return true if one of the following conditions is met: - There is a VariableOneToOne annotation present, or - The raw class is an interface and not a collection or map, nor a ValueHolderInterface (and an exclude default mappings flag is not set)

isVersionback to summary
public boolean isVersion(ClassAccessor classAccessor)

INTERNAL: Return true if this accessor represents a version mapping.

setAnnotationsback to summary
public void setAnnotations(Map<String, MetadataAnnotation> annotations)

INTERNAL: Set the annotations of this accessible object.

setAttributeNameback to summary
public void setAttributeName(String attributeName)

INTERNAL:

setGenericTypeback to summary
public void setGenericType(List<String> genericType)

INTERNAL:

setModifiersback to summary
public void setModifiers(int modifiers)

INTERNAL:

setNameback to summary
public void setName(String name)

INTERNAL:

setPrimitiveTypeback to summary
public void setPrimitiveType(Object primitiveType)

INTERNAL: If this annotated element was built from java model elements and is a primitive type this method will be called.

setTypeback to summary
public void setType(String type)

INTERNAL:

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

INTERNAL:

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override