|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.reflect.LazyClassDescriptorDecorator
public class LazyClassDescriptorDecorator
A ClassDescriptor wrapper that compiles decorated descriptor lazily on first access.
| Field Summary | |
|---|---|
protected ClassDescriptor |
descriptor
|
protected ClassDescriptorMap |
descriptorMap
|
protected java.lang.String |
entityName
|
| Constructor Summary | |
|---|---|
LazyClassDescriptorDecorator(ClassDescriptorMap descriptorMap,
java.lang.String entityName)
|
|
| Method Summary | |
|---|---|
protected void |
checkDescriptorInitialized()
Checks whether decorated descriptor is initialized, and if not, creates it using parent ClassDescriptorMap. |
java.lang.Object |
createObject()
Creates a new instance of a class described by this object. |
Property |
getDeclaredProperty(java.lang.String propertyName)
Returns a Java Bean property descriptor matching property name or null if no such property is found. |
ClassDescriptor |
getDescriptor()
Returns underlying descriptor used to delegate all processing, resolving it if needed. |
java.util.Collection<ObjAttribute> |
getDiscriminatorColumns()
Returns a collection of ObjAttribute for the described class, its superclasses and subclasses, that participate in inheritance qualifier. |
ObjEntity |
getEntity()
Returns an ObjEntity associated with this descriptor. |
EntityInheritanceTree |
getEntityInheritanceTree()
|
Expression |
getEntityQualifier()
Returns entity qualifier as a Cayenne expression that includes qualifiers for this entity and all subentities. |
java.util.Collection<AttributeProperty> |
getIdProperties()
Returns a collection of the properties mapped to id columns. |
java.util.Collection<ArcProperty> |
getMapArcProperties()
Returns a collection over the arc properties whose reverse arcs are to-many maps. |
java.lang.Class<?> |
getObjectClass()
Returns a class mapped by this descriptor. |
Property |
getProperty(java.lang.String propertyName)
Returns a property descriptor matching property name, or null if no such property is found. |
java.util.Collection<DbEntity> |
getRootDbEntities()
Returns a collection of DbEntities that are the root tables for this descriptor's ObjEntity. |
ClassDescriptor |
getSubclassDescriptor(java.lang.Class<?> objectClass)
Returns the most "specialized" descriptor for a given class. |
ClassDescriptor |
getSuperclassDescriptor()
Returns a descriptor of the mapped superclass or null if the descriptor's entity sits at the top of inheritance hierarchy or no inheritance is mapped. |
boolean |
hasSubclasses()
Returns whether this class has persistent subclasses. |
void |
injectValueHolders(java.lang.Object object)
Prepares object properties for access. |
boolean |
isFault(java.lang.Object object)
Returns true if an object is not fully resolved. |
void |
shallowMerge(java.lang.Object from,
java.lang.Object to)
Merges object properties from one object to another, avoiding traversal of the ArcProperties. |
java.lang.String |
toString()
|
boolean |
visitAllProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for a combination of all properties, including properties declared in this descriptor, its super descriptors, and all subdescriptors. |
boolean |
visitDeclaredProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for all properties declared in this descriptor. |
boolean |
visitProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for all properties declared in this descriptor and all its super-decsriptors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ClassDescriptor descriptor
protected ClassDescriptorMap descriptorMap
protected java.lang.String entityName
| Constructor Detail |
|---|
public LazyClassDescriptorDecorator(ClassDescriptorMap descriptorMap,
java.lang.String entityName)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectprotected void checkDescriptorInitialized()
ClassDescriptorMap.
public ClassDescriptor getDescriptor()
public java.lang.Object createObject()
ClassDescriptor
createObject in interface ClassDescriptorpublic Property getDeclaredProperty(java.lang.String propertyName)
ClassDescriptorAttributeProperty,
ToManyProperty, ToOneProperty.
getDeclaredProperty in interface ClassDescriptorpublic ObjEntity getEntity()
ClassDescriptor
getEntity in interface ClassDescriptorpublic java.util.Collection<DbEntity> getRootDbEntities()
ClassDescriptor
getRootDbEntities in interface ClassDescriptorpublic EntityInheritanceTree getEntityInheritanceTree()
getEntityInheritanceTree in interface ClassDescriptorpublic boolean hasSubclasses()
ClassDescriptor
hasSubclasses in interface ClassDescriptorpublic java.lang.Class<?> getObjectClass()
ClassDescriptor
getObjectClass in interface ClassDescriptorpublic java.util.Collection<AttributeProperty> getIdProperties()
ClassDescriptor
getIdProperties in interface ClassDescriptorpublic java.util.Collection<ObjAttribute> getDiscriminatorColumns()
ClassDescriptor
getDiscriminatorColumns in interface ClassDescriptorpublic Expression getEntityQualifier()
ClassDescriptor
getEntityQualifier in interface ClassDescriptorpublic java.util.Collection<ArcProperty> getMapArcProperties()
ClassDescriptorarc.getComplimentaryReverseArc() instanceof ToManyMapProperty
getMapArcProperties in interface ClassDescriptorpublic Property getProperty(java.lang.String propertyName)
ClassDescriptorAttributeProperty,
ToManyProperty, ToOneProperty.
getProperty in interface ClassDescriptorpublic ClassDescriptor getSubclassDescriptor(java.lang.Class<?> objectClass)
ClassDescriptorthis.getObjectClass().isAssignableFrom(objectClass)
getSubclassDescriptor in interface ClassDescriptorpublic ClassDescriptor getSuperclassDescriptor()
ClassDescriptor
getSuperclassDescriptor in interface ClassDescriptor
public void injectValueHolders(java.lang.Object object)
throws PropertyException
ClassDescriptor
injectValueHolders in interface ClassDescriptorPropertyExceptionpublic boolean isFault(java.lang.Object object)
ClassDescriptor
isFault in interface ClassDescriptor
public void shallowMerge(java.lang.Object from,
java.lang.Object to)
throws PropertyException
ClassDescriptor
shallowMerge in interface ClassDescriptorPropertyExceptionpublic boolean visitDeclaredProperties(PropertyVisitor visitor)
ClassDescriptor
visitDeclaredProperties in interface ClassDescriptorpublic boolean visitProperties(PropertyVisitor visitor)
ClassDescriptor
visitProperties in interface ClassDescriptorpublic boolean visitAllProperties(PropertyVisitor visitor)
ClassDescriptor
visitAllProperties in interface ClassDescriptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||