org.apache.cayenne.reflect
Class BaseToManyProperty
java.lang.Object
org.apache.cayenne.reflect.BaseProperty
org.apache.cayenne.reflect.BaseArcProperty
org.apache.cayenne.reflect.BaseToManyProperty
- All Implemented Interfaces:
- ArcProperty, Property, ToManyProperty
- Direct Known Subclasses:
- ListProperty
public abstract class BaseToManyProperty
- extends BaseArcProperty
- implements ToManyProperty
A generic superclass of CollectionProperty implementations.
- Since:
- 1.2
BaseToManyProperty
public BaseToManyProperty(ClassDescriptor owner,
ClassDescriptor targetDescriptor,
Accessor accessor,
String reverseName)
readProperty
public Object readProperty(Object object)
throws PropertyException
- Description copied from interface:
Property
- Returns a property value, inflating unresolved object if need.
- Specified by:
readProperty
in interface Property
- Overrides:
readProperty
in class BaseProperty
- Throws:
PropertyException
writePropertyDirectly
public void writePropertyDirectly(Object object,
Object oldValue,
Object newValue)
throws PropertyException
- Wraps list in a value holder that performs lazy faulting.
- Specified by:
writePropertyDirectly
in interface Property
- Overrides:
writePropertyDirectly
in class BaseProperty
- Throws:
PropertyException
addTarget
public void addTarget(Object source,
Object target,
boolean setReverse)
- Specified by:
addTarget
in interface ToManyProperty
removeTarget
public void removeTarget(Object source,
Object target,
boolean setReverse)
- Specified by:
removeTarget
in interface ToManyProperty
visit
public boolean visit(PropertyVisitor visitor)
- Description copied from interface:
Property
- A visitor accept method.
- Specified by:
visit
in interface Property
- Specified by:
visit
in class BaseArcProperty
- 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
- Injects a List in the object if it hasn't been done yet.
- Specified by:
injectValueHolder
in interface Property
- Overrides:
injectValueHolder
in class BaseProperty
- Throws:
PropertyException
ensureCollectionValueHolderSet
protected ValueHolder ensureCollectionValueHolderSet(Object object)
throws PropertyException
- Checks that an object's List field described by this property is set, injecting a
List if needed.
- Throws:
PropertyException
createCollectionValueHolder
protected abstract ValueHolder createCollectionValueHolder(Object object)
throws PropertyException
- Creates a Collection for an object.
- Throws:
PropertyException
Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.