Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

    public abstract class BaseToManyProperty

extends BaseArcProperty
implements ToManyProperty

A generic superclass of CollectionProperty implementations.

Since:
  1.2

Field Summary

Fields inherited from class org.apache.cayenne.reflect.BaseArcProperty
`complimentaryReverseArcName, relationship, targetDescriptor`

Fields inherited from class org.apache.cayenne.reflect.BaseProperty
`accessor, owner`

Constructor Summary
`BaseToManyProperty(ClassDescriptor owner, ClassDescriptor targetDescriptor, Accessor accessor, java.lang.String reverseName)`

Method Summary
`void` | `addTarget(java.lang.Object source, java.lang.Object target, boolean setReverse)`
`void` | `addTargetDirectly(java.lang.Object source, java.lang.Object target)` Adds value to collection, without triggering changing events This method is mostly for internal use
`protected abstract ValueHolder` | `createCollectionValueHolder(java.lang.Object object)` Creates a Collection for an object.
`protected ValueHolder` | `ensureCollectionValueHolderSet(java.lang.Object object)` Checks that an object's List field described by this property is set, injecting a List if needed.
`void` | `injectValueHolder(java.lang.Object object)` Injects a List in the object if it hasn't been done yet.
`java.lang.Object` | `readProperty(java.lang.Object object)` Returns a property value, inflating unresolved object if need.
`void` | `removeTarget(java.lang.Object source, java.lang.Object target, boolean setReverse)`
`void` | `removeTargetDirectly(java.lang.Object source, java.lang.Object target)` Removes value from collection, without triggering changing events This method is mostly for internal use
`boolean` | `visit(PropertyVisitor visitor)` A visitor accept method.
`void` | `writePropertyDirectly(java.lang.Object object, java.lang.Object oldValue, java.lang.Object newValue)` Wraps list in a value holder that performs lazy faulting.

Methods inherited from class org.apache.cayenne.reflect.BaseArcProperty
`getComplimentaryReverseArc, getRelationship, getTargetDescriptor, isFault, setReverse`

Methods inherited from class org.apache.cayenne.reflect.BaseProperty
`getName, readPropertyDirectly, toString, writeProperty`

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.ArcProperty
`getComplimentaryReverseArc, getRelationship, getTargetDescriptor, invalidate, isFault`

Methods inherited from interface org.apache.cayenne.reflect.Property
`getName, readPropertyDirectly, writeProperty`

Constructor Detail

### BaseToManyProperty

    public BaseToManyProperty(ClassDescriptor owner,
                              ClassDescriptor targetDescriptor,
                              Accessor accessor,
                              java.lang.String reverseName)

Method Detail

### readProperty

    public java.lang.Object readProperty(java.lang.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(java.lang.Object object,
                                      java.lang.Object oldValue,
                                      java.lang.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(java.lang.Object source,
                          java.lang.Object target,
                          boolean setReverse)

  Specified by:
    `addTarget` in interface `ToManyProperty`

### addTargetDirectly

    public void addTargetDirectly(java.lang.Object source,
                                  java.lang.Object target)
                           throws PropertyException

  Description copied from interface: `ToManyProperty`
  Adds value to collection, without triggering changing events This method is mostly for internal use

  Specified by:
    `addTargetDirectly` in interface `ToManyProperty`
  Throws:
    `PropertyException`

### removeTargetDirectly

    public void removeTargetDirectly(java.lang.Object source,
                                     java.lang.Object target)
                              throws PropertyException

  Description copied from interface: `ToManyProperty`
  Removes value from collection, without triggering changing events This method is mostly for internal use

  Specified by:
    `removeTargetDirectly` in interface `ToManyProperty`
  Throws:
    `PropertyException`

### removeTarget

    public void removeTarget(java.lang.Object source,
                             java.lang.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(java.lang.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(java.lang.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(java.lang.Object object)
                                                        throws PropertyException

  Creates a Collection for an object.

  Throws:
    `PropertyException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.