Package org.apache.cayenne.reflect
Class BaseProperty
- java.lang.Object
-
- org.apache.cayenne.reflect.BaseProperty
-
- All Implemented Interfaces:
PropertyDescriptor
- Direct Known Subclasses:
BaseArcProperty
,SimpleAttributeProperty
public abstract class BaseProperty extends Object implements PropertyDescriptor
An abstract property descriptor that delegates property access to anAccessor
. Used as a superclass for other implementations.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected Accessor
accessor
protected ClassDescriptor
owner
-
Constructor Summary
Constructors Constructor Description BaseProperty(ClassDescriptor owner, Accessor accessor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getName()
Returns property name.void
injectValueHolder(Object object)
Does nothing.Object
readProperty(Object object)
Returns a property value, inflating unresolved object if need.Object
readPropertyDirectly(Object object)
Returns a property value of an object without disturbing the object fault status.String
toString()
abstract boolean
visit(PropertyVisitor visitor)
A visitor accept method.void
writeProperty(Object object, Object oldValue, Object newValue)
Sets a property value, inflating unresolved object if need.void
writePropertyDirectly(Object object, Object oldValue, Object newValue)
Sets a property value of an object without disturbing the object fault status.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cayenne.reflect.PropertyDescriptor
equals
-
-
-
-
Field Detail
-
owner
protected ClassDescriptor owner
-
accessor
protected Accessor accessor
-
-
Constructor Detail
-
BaseProperty
public BaseProperty(ClassDescriptor owner, Accessor accessor)
-
-
Method Detail
-
readProperty
public Object readProperty(Object object) throws PropertyException
Description copied from interface:PropertyDescriptor
Returns a property value, inflating unresolved object if need.- Specified by:
readProperty
in interfacePropertyDescriptor
- Throws:
PropertyException
-
writeProperty
public void writeProperty(Object object, Object oldValue, Object newValue) throws PropertyException
Description copied from interface:PropertyDescriptor
Sets a property value, inflating unresolved object if need. Old value of the property is specified as a hint and can be ignored by the property implementor.- Specified by:
writeProperty
in interfacePropertyDescriptor
- Throws:
PropertyException
-
getName
public String getName()
Description copied from interface:PropertyDescriptor
Returns property name.- Specified by:
getName
in interfacePropertyDescriptor
-
visit
public abstract boolean visit(PropertyVisitor visitor)
Description copied from interface:PropertyDescriptor
A visitor accept method.- Specified by:
visit
in interfacePropertyDescriptor
- Returns:
- a status returned by the corresponding callback method of the visitor. It serves as an indication of whether peer properties processing is still needed.
-
injectValueHolder
public void injectValueHolder(Object object) throws PropertyException
Does nothing.- Specified by:
injectValueHolder
in interfacePropertyDescriptor
- Throws:
PropertyException
-
readPropertyDirectly
public Object readPropertyDirectly(Object object) throws PropertyException
Description copied from interface:PropertyDescriptor
Returns a property value of an object without disturbing the object fault status.- Specified by:
readPropertyDirectly
in interfacePropertyDescriptor
- Throws:
PropertyException
-
writePropertyDirectly
public void writePropertyDirectly(Object object, Object oldValue, Object newValue) throws PropertyException
Description copied from interface:PropertyDescriptor
Sets a property value of an object without disturbing the object fault status. Old value of the property is specified as a hint and can be ignored by the property implementor.- Specified by:
writePropertyDirectly
in interfacePropertyDescriptor
- Throws:
PropertyException
-
-