|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.reflect.PersistentDescriptor
public class PersistentDescriptor
A default ClassDescriptor implementation for persistent objects.
| Field Summary | |
|---|---|
protected Collection |
declaredIdProperties
|
protected Collection |
declaredMapArcProperties
|
protected Map |
declaredProperties
|
protected ObjEntity |
entity
|
protected Class |
objectClass
|
protected Accessor |
persistenceStateAccessor
|
protected Map |
subclassDescriptors
|
protected ClassDescriptor |
superclassDescriptor
|
| Constructor Summary | |
|---|---|
PersistentDescriptor()
Creates a PersistentDescriptor. |
|
| Method Summary | |
|---|---|
void |
addDeclaredProperty(Property property)
Registers a property. |
void |
addSubclassDescriptor(ClassDescriptor subclassDescriptor)
|
Object |
createObject()
Creates a new instance of a class described by this object. |
Property |
getDeclaredProperty(String propertyName)
Returns a Java Bean property descriptor matching property name or null if no such property is found. |
ObjEntity |
getEntity()
Returns an ObjEntity associated with this descriptor. |
Iterator |
getIdProperties()
Returns an iterator over the properties mapped to id columns. |
Iterator |
getMapArcProperties()
Returns an iterator over the arc properties whose reverse arcs are to-many maps. |
Class |
getObjectClass()
Returns a class mapped by this descriptor. |
Iterator |
getProperties()
Deprecated. since 3.0. Use visitProperties(PropertyVisitor) method
instead. |
Property |
getProperty(String propertyName)
Recursively looks up property descriptor in this class descriptor and all superclass descriptors. |
ClassDescriptor |
getSubclassDescriptor(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(Object object)
Invokes 'prepareForAccess' of a super descriptor and then invokes 'prepareForAccess' of each declared property. |
boolean |
isFault(Object object)
Returns true if an object is not fully resolved. |
void |
removeDeclaredProperty(String propertyName)
Removes declared property. |
void |
setEntity(ObjEntity entity)
|
void |
setPersistenceStateAccessor(Accessor persistenceStateAccessor)
|
void |
setSuperclassDescriptor(ClassDescriptor superclassDescriptor)
|
void |
shallowMerge(Object from,
Object to)
Copies object properties from one object to another. |
boolean |
visitAllProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for all properties declared in this descriptor, its super and subdescriptors, terminating properties walkthrough in case one of the properties returns false. |
boolean |
visitDeclaredProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for all properties declared in this descriptor, terminating properties walkthrough in case one of the properties returns false. |
boolean |
visitProperties(PropertyVisitor visitor)
Passes the visitor to all properties "visit" method, terminating properties walkthrough 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 Class objectClass
protected Map declaredProperties
protected Map subclassDescriptors
protected Accessor persistenceStateAccessor
protected ObjEntity entity
protected Collection declaredIdProperties
protected Collection declaredMapArcProperties
| Constructor Detail |
|---|
public PersistentDescriptor()
| Method Detail |
|---|
public void addDeclaredProperty(Property property)
public void removeDeclaredProperty(String propertyName)
public void addSubclassDescriptor(ClassDescriptor subclassDescriptor)
public ObjEntity getEntity()
ClassDescriptor
getEntity in interface ClassDescriptorpublic boolean isFault(Object object)
ClassDescriptor
isFault in interface ClassDescriptorpublic Class getObjectClass()
ClassDescriptor
getObjectClass in interface ClassDescriptorpublic ClassDescriptor getSubclassDescriptor(Class objectClass)
ClassDescriptorthis.getObjectClass().isAssignableFrom(objectClass)
getSubclassDescriptor in interface ClassDescriptorpublic Iterator getProperties()
visitProperties(PropertyVisitor) method
instead.
ClassDescriptor
getProperties in interface ClassDescriptorpublic Iterator getIdProperties()
ClassDescriptor
getIdProperties in interface ClassDescriptorpublic Iterator getMapArcProperties()
ClassDescriptorarc.getComplimentaryReverseArc() instanceof ToManyMapProperty
getMapArcProperties in interface ClassDescriptorpublic Property getProperty(String propertyName)
getProperty in interface ClassDescriptorpublic Property getDeclaredProperty(String propertyName)
ClassDescriptorAttributeProperty,
ToManyProperty, ToOneProperty.
getDeclaredProperty in interface ClassDescriptorpublic ClassDescriptor getSuperclassDescriptor()
getSuperclassDescriptor in interface ClassDescriptorpublic Object createObject()
createObject in interface ClassDescriptor
public void injectValueHolders(Object object)
throws PropertyException
injectValueHolders in interface ClassDescriptorPropertyException
public void shallowMerge(Object from,
Object to)
throws PropertyException
shallowMerge in interface ClassDescriptorPropertyExceptionpublic boolean visitDeclaredProperties(PropertyVisitor visitor)
ClassDescriptor
visitDeclaredProperties in interface ClassDescriptorpublic boolean visitAllProperties(PropertyVisitor visitor)
ClassDescriptor
visitAllProperties in interface ClassDescriptorpublic boolean visitProperties(PropertyVisitor visitor)
ClassDescriptor
visitProperties in interface ClassDescriptorpublic void setPersistenceStateAccessor(Accessor persistenceStateAccessor)
public void setEntity(ObjEntity entity)
public void setSuperclassDescriptor(ClassDescriptor superclassDescriptor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||