public class ObjectArrayFormat extends Format
PrimitiveArrayFormat
class
handles primitive arrays of one dimension only.
In this class, and PrimitiveArrayFormat
, we resort to using
reflection to allocate multidimensional arrays. If there is a need for it,
reflection could be avoided in the future by generating code as new array
formats are encountered.Modifier and Type | Method and Description |
---|---|
Format |
getComponentType()
Returns the array component type, or null if this is not an array type.
|
int |
getDimensions()
Returns the number of array dimensions, or zero if this is not an array
type.
|
boolean |
isArray()
Returns whether this is an array type.
|
java.lang.Object |
newInstance(EntityInput input,
boolean rawAccess)
Creates a new instance of the target class using its default
constructor.
|
java.lang.Object |
readObject(java.lang.Object o,
EntityInput input,
boolean rawAccess)
Called after newInstance() to read the rest of the data bytes and fill
in the object contents.
|
allowEvolveFromProxy, getAccessor, getClassMetadata, getClassName, getEntityMetadata, getEnumConstants, getFields, getId, getOldKeyName, getPreviousVersion, getSuperType, getVersion, initializeReader, isDeleted, isEnum, isPrimitive, isSimple, readPriKey, toString
public boolean isArray()
RawType
RawObject
instances.
If true is returned, the array component type is returned by RawType.getComponentType()
and the number of array dimensions is returned by
RawType.getDimensions()
.
If false is returned, then this is a complex type, an enum type (see
RawType.isEnum()
), or a simple type (see RawType.isSimple()
).
public int getDimensions()
RawType
getDimensions
in interface RawType
getDimensions
in class Format
public Format getComponentType()
RawType
getComponentType
in interface RawType
getComponentType
in class Format
public java.lang.Object newInstance(EntityInput input, boolean rawAccess)
Format
newInstance
in class Format
public java.lang.Object readObject(java.lang.Object o, EntityInput input, boolean rawAccess) throws RefreshException
Format
readObject
in class Format
RefreshException