public abstract class Format extends java.lang.Object implements RawType, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClassName()
Returns the class name for this type in the format specified by
Class.getName() . |
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.
|
java.util.List<java.lang.String> |
getEnumConstants()
Returns an unmodifiable list of the names of the enum instances, or null
if this is not an enum type.
|
java.util.Map<java.lang.String,RawField> |
getFields()
Returns a map of field name to raw field for each non-static
non-transient field declared in this class, or null if this is not a
complex type (in other words, this is a simple type or an array type).
|
Format |
getPreviousVersion()
Returns the previous version of this format in the linked list of
versions, or null if this is the only version.
|
Format |
getSuperType()
Returns the type of the superclass, or null if the superclass is Object
or this is not a complex type (in other words, this is a simple type or
an array type).
|
int |
getVersion()
Returns the class version for this type.
|
void |
initializeReader(com.sleepycat.persist.impl.Catalog catalog,
int initVersion,
Format oldFormat)
Called to initialize a separate Reader implementation.
|
boolean |
isArray()
Returns whether this is an array type.
|
boolean |
isEnum()
Returns whether this is an enum type.
|
boolean |
isPrimitive()
Returns whether this type is a Java primitive: char, byte, short, int,
long, float or double.
|
boolean |
isSimple()
Returns whether this is a simple type: primitive,
primitive wrapper, BigInteger, String or Date.
|
abstract java.lang.Object |
newInstance(EntityInput input,
boolean rawAccess)
Creates a new instance of the target class using its default
constructor.
|
abstract 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.
|
void |
readPriKey(java.lang.Object o,
EntityInput input,
boolean rawAccess)
Reads the primary key from the given input bytes and sets the primary
key field in the given object.
|
java.lang.String |
toString() |
public final Format getPreviousVersion()
public void initializeReader(com.sleepycat.persist.impl.Catalog catalog, int initVersion, Format oldFormat)
public java.lang.String getClassName()
RawType
Class.getName()
.
If this class currently exists (has not been removed or renamed) then
the class name may be passed to Class.forName(java.lang.String)
to get the current
Class
object. However, if this raw type is not the current
version of the class, this type information may differ from that of the
current Class
.
getClassName
in interface RawType
public int getVersion()
RawType
getVersion
in interface RawType
Entity.version()
,
Persistent.version()
public Format getSuperType()
RawType
getSuperType
in interface RawType
public boolean isSimple()
RawType
If true is returned, RawType.isPrimitive()
can be called for more
information, and a raw value of this type is represented as a simple
type object (not as a RawObject
).
If false is returned, this is a complex type, an array type (see
RawType.isArray()
), or an enum type, and a raw value of this type is
represented as a RawObject
.
public boolean isPrimitive()
RawType
If true is returned, this is also a simple type. In other words, primitive types are a subset of simple types.
If true is returned, a raw value of this type is represented as a
non-null instance of the primitive type's wrapper class. For example,
an int
raw value is represented as an
Integer
.
isPrimitive
in interface RawType
public boolean isEnum()
RawType
If true is returned, a value of this type is a RawObject
and
the enum constant String is available via RawObject.getEnum()
.
If false is returned, then this is a complex type, an array type (see
RawType.isArray()
), or a simple type (see RawType.isSimple()
).
public java.util.List<java.lang.String> getEnumConstants()
RawType
getEnumConstants
in interface RawType
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
public Format getComponentType()
RawType
getComponentType
in interface RawType
public java.util.Map<java.lang.String,RawField> getFields()
RawType
public abstract java.lang.Object newInstance(EntityInput input, boolean rawAccess)
public abstract java.lang.Object readObject(java.lang.Object o, EntityInput input, boolean rawAccess)
public void readPriKey(java.lang.Object o, EntityInput input, boolean rawAccess)
public java.lang.String toString()
toString
in class java.lang.Object