public abstract class MetadataAccessor extends Object
Modifier and Type | Field and Description |
---|---|
protected MetadataAccessibleObject |
m_accessibleObject |
protected MetadataDescriptor |
m_descriptor |
protected MetadataLogger |
m_logger |
protected MetadataProcessor |
m_processor |
protected MetadataProject |
m_project |
protected MetadataValidator |
m_validator |
Constructor and Description |
---|
MetadataAccessor(MetadataAccessibleObject accessibleObject,
ClassAccessor classAccessor)
INTERNAL:
|
MetadataAccessor(MetadataAccessibleObject accessibleObject,
MetadataProcessor processor,
MetadataDescriptor descriptor)
INTERNAL:
|
Modifier and Type | Method and Description |
---|---|
AnnotatedElement |
getAnnotatedElement()
INTERNAL:
Return the annotated element for this accessor.
|
protected <T extends Annotation> |
getAnnotation(Class annotation)
INTERNAL:
Return the annotated element for this accessor.
|
protected <T extends Annotation> |
getAnnotation(Class annotation,
AnnotatedElement annotatedElement)
INTERNAL:
Return the annotated element for this accessor.
|
String |
getAttributeName()
INTERNAL:
Return the attribute name for this accessor.
|
MetadataDescriptor |
getDescriptor()
INTERNAL:
Return the MetadataDescriptor for this accessor.
|
String |
getFetchType()
INTERNAL:
Subclasses that support processing a fetch type should override this
method, otherwise a runtime development exception is thrown for those
accessors who call this method and don't implement it themselves.
|
Class |
getJavaClass()
INTERNAL: (Overridden in ClassAccessor)
Return the java class associated with this accessor's descriptor.
|
protected String |
getJavaClassName()
INTERNAL:
Return the java class that defines this accessor.
|
MetadataLogger |
getLogger()
INTERNAL:
Return the metadata validator.
|
protected Class |
getMapKeyClass()
INTERNAL:
Return the map key class from a generic Map type.
|
String |
getName()
INTERNAL:
Returns the name of this accessor.
|
protected String |
getName(DatabaseField field,
String defaultName,
String context)
INTERNAL:
Helper method to return a field name from a candidate field name and a
default field name.
|
protected String |
getName(String name,
String defaultName,
String context)
INTERNAL:
Helper method to return a field name from a candidate field name and a
default field name.
|
protected MetadataPrimaryKeyJoinColumns |
getPrimaryKeyJoinColumns(String sourceTableName,
String targetTableName)
INTERNAL: (Overridden in XMLClassAccessor and XMLOneToOneAccessor)
Process the @PrimaryKeyJoinColumns and @PrimaryKeyJoinColumn.
|
MetadataProcessor |
getProcessor()
INTERNAL:
Return the MetadataProcessor.
|
MetadataProject |
getProject()
INTERNAL:
Return the MetadataProject.
|
Class |
getRawClass()
INTERNAL:
Return the raw class for this accessor.
|
Class |
getReferenceClass()
INTERNAL: (Overridden in CollectionAccessor and ObjectAccessor)
Return the reference class for this accessor.
|
String |
getReferenceClassName()
INTERNAL:
Return the reference class name for this accessor.
|
MetadataDescriptor |
getReferenceDescriptor()
INTERNAL:
Return the reference metadata descriptor for this accessor.
|
protected Type |
getRelationType()
INTERNAL:
Return the relation type of this accessor.
|
protected String |
getSetMethodName()
INTERNAL:
Returns the set method name of a method accessor.
|
protected String |
getUpperCaseAttributeName()
INTERNAL:
Return the upper cased attribute name for this accessor.
|
protected String |
getUpperCaseShortJavaClassName()
INTERNAL:
Return the upper case java class that defines this accessor.
|
MetadataValidator |
getValidator()
INTERNAL:
Return the metadata validator.
|
protected boolean |
hasColumn()
INTERNAL:
Method to check if an annotated element has a @Column.
|
protected boolean |
hasPrimaryKeyJoinColumns()
INTERNAL:
Method to check if this accessor has @PrimaryKeyJoinColumns.
|
protected boolean |
isAnnotationPresent(Class<? extends Annotation> annotation)
INTERNAL:
Indicates whether the specified annotation is present on the annotated
element for this accessor.
|
protected boolean |
isAnnotationPresent(Class<? extends Annotation> annotation,
AnnotatedElement annotatedElement)
INTERNAL:
Indicates whether the specified annotation is present on the annotated
element for this accessor.
|
boolean |
isBasic()
INTERNAL:
Return true if this accessor represents a basic mapping.
|
boolean |
isClass()
INTERNAL:
Return true if this accessor represents a class.
|
boolean |
isEmbedded()
INTERNAL:
Return true if this accessor represents an aggregate mapping.
|
boolean |
isEmbeddedId()
INTERNAL:
Return true if this accessor represents an aggregate id mapping.
|
boolean |
isManyToMany()
INTERNAL:
Return true if this accessor represents a m-m relationship.
|
boolean |
isManyToOne()
INTERNAL:
Return true if this accessor represents a m-1 relationship.
|
boolean |
isOneToMany()
INTERNAL:
Return true if this accessor represents a 1-m relationship.
|
boolean |
isOneToOne()
INTERNAL:
Return true if this accessor represents a 1-1 relationship.
|
boolean |
isOptional()
INTERNAL:
Subclasses that support processing an optional setting should override
this method, otherwise a runtime development exception is thrown for
those accessors who call this method and don't implement it themselves.
|
boolean |
isProcessed()
INTERNAL:
Return true if this accessor has already been processed.
|
boolean |
isRelationship()
INTERNAL:
Return true if this accessor method represents a relationship.
|
boolean |
isXMLAccessor()
INTERNAL:
Return true if this is an XML processing accessor.
|
abstract void |
process()
INTERNAL:
Every accessor knows how to process themselves since they have all the
information they need.
|
protected ClassAccessor |
processAccessor(MetadataDescriptor descriptor)
INTERNAL: (Overidden in XMLClassAccessor and XMLEmbeddedAccessor)
Fast track processing a ClassAccessor for the given descriptor.
|
protected List<MetadataPrimaryKeyJoinColumn> |
processPrimaryKeyJoinColumns(MetadataPrimaryKeyJoinColumns primaryKeyJoinColumns)
INTERNAL:
Process the primary key join columms for this accessors annotated element.
|
protected void |
processTable(MetadataTable table,
String defaultName)
INTERNAL:
Common table processing for table, secondary table, join table and
collection table.
|
protected void |
setAccessorMethods(DatabaseMapping mapping)
INTERNAL:
Set the getter and setter access methods for this accessor.
|
void |
setAnnotatedElement(AnnotatedElement annotatedElement)
INTERNAL:
Return the annotated element for this accessor.
|
protected void |
setIndirectionPolicy(CollectionMapping mapping,
String mapKey)
INTERNAL:
Set the correct indirection policy on a collection mapping.
|
void |
setIsProcessed()
INTERNAL:
|
boolean |
usesIndirection()
INTERNAL:
|
protected MetadataLogger m_logger
protected MetadataProject m_project
protected MetadataProcessor m_processor
protected MetadataValidator m_validator
protected MetadataDescriptor m_descriptor
protected MetadataAccessibleObject m_accessibleObject
public MetadataAccessor(MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)
public MetadataAccessor(MetadataAccessibleObject accessibleObject, MetadataProcessor processor, MetadataDescriptor descriptor)
public AnnotatedElement getAnnotatedElement()
protected <T extends Annotation> T getAnnotation(Class annotation)
protected <T extends Annotation> T getAnnotation(Class annotation, AnnotatedElement annotatedElement)
public String getAttributeName()
public MetadataDescriptor getDescriptor()
public String getFetchType()
public Class getJavaClass()
protected String getJavaClassName()
public MetadataLogger getLogger()
protected Class getMapKeyClass()
public String getName()
protected String getName(DatabaseField field, String defaultName, String context)
protected String getName(String name, String defaultName, String context)
protected MetadataPrimaryKeyJoinColumns getPrimaryKeyJoinColumns(String sourceTableName, String targetTableName)
public MetadataProject getProject()
public MetadataProcessor getProcessor()
public Class getRawClass()
public Class getReferenceClass()
public String getReferenceClassName()
public MetadataDescriptor getReferenceDescriptor()
protected Type getRelationType()
protected String getSetMethodName()
protected String getUpperCaseAttributeName()
protected String getUpperCaseShortJavaClassName()
public MetadataValidator getValidator()
protected boolean hasColumn()
protected boolean hasPrimaryKeyJoinColumns()
protected boolean isAnnotationPresent(Class<? extends Annotation> annotation)
protected boolean isAnnotationPresent(Class<? extends Annotation> annotation, AnnotatedElement annotatedElement)
public boolean isBasic()
public boolean isClass()
public boolean isEmbedded()
public boolean isEmbeddedId()
public boolean isManyToMany()
public boolean isManyToOne()
public boolean isOneToMany()
public boolean isOneToOne()
public boolean isOptional()
public boolean isRelationship()
public boolean isXMLAccessor()
public boolean isProcessed()
public abstract void process()
protected ClassAccessor processAccessor(MetadataDescriptor descriptor)
protected List<MetadataPrimaryKeyJoinColumn> processPrimaryKeyJoinColumns(MetadataPrimaryKeyJoinColumns primaryKeyJoinColumns)
protected void processTable(MetadataTable table, String defaultName)
protected void setAccessorMethods(DatabaseMapping mapping)
public void setAnnotatedElement(AnnotatedElement annotatedElement)
protected void setIndirectionPolicy(CollectionMapping mapping, String mapKey)
public void setIsProcessed()
public boolean usesIndirection()
Copyright © 2024. All rights reserved.