|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.property.BaseClassDescriptor
public abstract class BaseClassDescriptor
A superclass of Cayenne ClassDescriptors. Defines all main bean descriptor parameters and operations. Subclasses would provide methods to initialize the descriptor.
Field Summary | |
---|---|
protected java.util.Map |
declaredProperties
|
protected java.lang.Class |
objectClass
|
protected PropertyAccessor |
persistenceStateProperty
|
protected java.util.Map |
subclassDescriptors
|
protected ClassDescriptor |
superclassDescriptor
|
protected java.util.Map |
valueHolderProperties
|
Constructor Summary | |
---|---|
BaseClassDescriptor(ClassDescriptor superclassDescriptor)
Creates an uncompiled BaseClassDescriptor. |
Method Summary | |
---|---|
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. |
java.lang.Class |
getObjectClass()
Returns a bean class mapped by this descriptor. |
java.util.Iterator |
getProperties()
Returns an Iterator over descriptor properties. |
Property |
getProperty(java.lang.String propertyName)
Recursively looks up property descriptor in this class descriptor and all superclass descriptors. |
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. |
void |
injectValueHolders(java.lang.Object object)
Invokes 'prepareForAccess' of a super descriptor and then invokes 'prepareForAccess' of each declared property. |
boolean |
isFault(java.lang.Object object)
Returns true if an object is not fully resolved. |
boolean |
isValid()
Returns true if a descriptor is initialized and ready for operation. |
void |
shallowMerge(java.lang.Object from,
java.lang.Object to)
Copies object properties from one object to another. |
boolean |
visitProperties(PropertyVisitor visitor)
Passes the visitor to all properties "visit" method, terminating properties walk through in case one of the properties returns false. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClassDescriptor superclassDescriptor
protected java.lang.Class objectClass
protected java.util.Map declaredProperties
protected java.util.Map valueHolderProperties
protected java.util.Map subclassDescriptors
protected PropertyAccessor persistenceStateProperty
Constructor Detail |
---|
public BaseClassDescriptor(ClassDescriptor superclassDescriptor)
Method Detail |
---|
public boolean isFault(java.lang.Object object)
ClassDescriptor
isFault
in interface ClassDescriptor
public boolean isValid()
public java.lang.Class getObjectClass()
ClassDescriptor
getObjectClass
in interface ClassDescriptor
public ClassDescriptor getSubclassDescriptor(java.lang.Class objectClass)
ClassDescriptor
this.getObjectClass().isAssignableFrom(objectClass)
getSubclassDescriptor
in interface ClassDescriptor
public java.util.Iterator getProperties()
ClassDescriptor
getProperties
in interface ClassDescriptor
public Property getProperty(java.lang.String propertyName)
getProperty
in interface ClassDescriptor
public Property getDeclaredProperty(java.lang.String propertyName)
ClassDescriptor
getDeclaredProperty
in interface ClassDescriptor
public ClassDescriptor getSuperclassDescriptor()
getSuperclassDescriptor
in interface ClassDescriptor
public java.lang.Object createObject()
createObject
in interface ClassDescriptor
public void injectValueHolders(java.lang.Object object) throws PropertyAccessException
injectValueHolders
in interface ClassDescriptor
PropertyAccessException
public void shallowMerge(java.lang.Object from, java.lang.Object to) throws PropertyAccessException
shallowMerge
in interface ClassDescriptor
PropertyAccessException
public boolean visitProperties(PropertyVisitor visitor)
ClassDescriptor
visitProperties
in interface ClassDescriptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |