com.googlecode.objectify.impl.load
Class EmbeddedCollectionSetter

java.lang.Object
  extended by com.googlecode.objectify.impl.load.Setter
      extended by com.googlecode.objectify.impl.load.CollisionDetectingSetter
          extended by com.googlecode.objectify.impl.load.EmbeddedMultivalueSetter
              extended by com.googlecode.objectify.impl.load.EmbeddedCollectionSetter
All Implemented Interfaces:
java.lang.Cloneable

public class EmbeddedCollectionSetter
extends EmbeddedMultivalueSetter

This setter handles embedded collections similar to embedded arrays. The special consideration of collections follows the documentation for TypeUtils.prepareCollection().

See Also:
TypeUtils.prepareCollection(Object, com.googlecode.objectify.impl.Wrapper, int)

Constructor Summary
EmbeddedCollectionSetter(java.lang.reflect.Field field, java.lang.String path, java.util.Collection<java.lang.String> collsionPaths)
           
 
Method Summary
protected  java.lang.reflect.Constructor<?> getComponentConstructor()
           
protected  java.util.Collection<java.lang.Object> getOrCreateCollection(java.lang.Object onPojo, int size)
          Gets the collection in the relevant field of the specified POJO, or creates (and sets) a new one.
 
Methods inherited from class com.googlecode.objectify.impl.load.EmbeddedMultivalueSetter
safeSet
 
Methods inherited from class com.googlecode.objectify.impl.load.CollisionDetectingSetter
set
 
Methods inherited from class com.googlecode.objectify.impl.load.Setter
clone, extend, getNext
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedCollectionSetter

public EmbeddedCollectionSetter(java.lang.reflect.Field field,
                                java.lang.String path,
                                java.util.Collection<java.lang.String> collsionPaths)
Method Detail

getComponentConstructor

protected java.lang.reflect.Constructor<?> getComponentConstructor()
Specified by:
getComponentConstructor in class EmbeddedMultivalueSetter
Returns:
the no-arg constructor of the embedded type

getOrCreateCollection

protected java.util.Collection<java.lang.Object> getOrCreateCollection(java.lang.Object onPojo,
                                                                       int size)
Description copied from class: EmbeddedMultivalueSetter
Gets the collection in the relevant field of the specified POJO, or creates (and sets) a new one. If the field is an array type, set it up and return a Collection facade of the array.

Specified by:
getOrCreateCollection in class EmbeddedMultivalueSetter
Parameters:
onPojo - is the entity pojo that has a field for us to set
size - is the size of the pojo to create, if necessary


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1