com.googlecode.objectify.impl.load.EmbeddedArraySetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectify Show documentation
Show all versions of objectify Show documentation
*** THIS VERSION UPLOADED FOR USE WITH CEDAR-COMMON, TO AVOID DEPENDENCIES ON GOOGLE CODE-BASED MAVEN REPOSITORIES. *** The simplest convenient interface to the Google App Engine datastore
The newest version!
package com.googlecode.objectify.impl.load;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import com.googlecode.objectify.impl.TypeUtils;
/**
* This setter handles an embedded array by constructing the array and all the objects
* inside. It expects the value to be a collection type so it "fans out" the values to
* all the embedded objects in the array, calling the next setter in the chain with each
* value.
*/
public class EmbeddedArraySetter extends EmbeddedMultivalueSetter
{
Class componentType;
Constructor componentTypeCtor;
/**
* The lame Arrays.asList() wrapper doesn't support the clear() operation, and
* we need to be able to set the size back to 0 for our newly crated array of
* nulls. This wrapper uses the array as a backing store but it doesn't start
* out thinking the collection is populated.
*/
static class EmptyArrayListWrapper extends AbstractList