public final class ArrayType extends DataType
EMessageObject objects of the
same class type.
Supports array sizes up to DataType.MAX_ARRAY_SIZE items.
ADDRESS_TYPE, ARRAY_SUFFIX, CHARSET, CLASS_TYPE, EMPTY_STRING, FIELD_MASK_SIZE, INDENT, INDENT1, KEY_TYPE, MAX_ARRAY_SIZE, MAX_FIELDS, MAX_FILE_NAME_LENGTH, MAX_STRING_LENGTH, mBuiltinFlag, mClass, mDefaultValue, mSize, sClasses, sCompiledClasses, STRING_TYPE, VARIABLE_SIZE| Constructor and Description |
|---|
ArrayType(Class<?> jClass,
DataType subtype)
Creates an array type which encapsulates the specified
data type.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createDeserializer(MessageType.MessageField field,
String fieldName,
String indent,
Formatter output,
boolean useBuilder)
Generates the Java code for de-serializing an array.
|
protected void |
createSerializer(MessageType.MessageField field,
String fieldName,
String indent,
Formatter output)
Generates the array serialization code.
|
String |
dataClassName()
Returns the Java class name with "[]" appended.
|
Object |
deserialize(ByteBuffer buffer)
Returns the deserialized collection as an
Object. |
boolean |
isInstance(Object o)
Returns
true if o is either null
or a Collection instance; false otherwise. |
void |
serialize(Object o,
ByteBuffer buffer)
Serializes this list to the buffer.
|
DataType |
subtype()
Returns the array subtype.
|
String |
toString()
Returns the subtype Java class name followed by "[]".
|
compareTo, dataClass, defaultValue, equals, fields, findCharset, findType, hashCode, isArray, isBuiltin, isEnum, isLocalOnly, isMessage, isPrimitive, replyClasses, sizepublic boolean isInstance(Object o)
true if o is either null
or a Collection instance; false otherwise.isInstance in class DataTypeo - Check this object's type.true if o is either null
or a Collection instance; false otherwise.public void serialize(Object o, ByteBuffer buffer) throws BufferOverflowException
serialize in class DataTypeo - a list of objects.buffer - serialize to this buffer.BufferOverflowException - if buffer overflows.deserialize(ByteBuffer)public Object deserialize(ByteBuffer buffer) throws BufferUnderflowException
Object.
If the array size is zero, then returns an empty
collection. The returned value may be safely typecast to
java.util.Collection.deserialize in class DataTypebuffer - Deserialize the list object from this
ByteBuffer.Collection.BufferUnderflowException - if buffer contains an incomplete serialized array.serialize(Object, ByteBuffer)protected void createSerializer(MessageType.MessageField field, String fieldName, String indent, Formatter output)
createSerializer in class DataTypefield - message field.fieldName - fully-qualified field name.indent - indent generated code by this spacing.output - place generated code into this formatter.protected void createDeserializer(MessageType.MessageField field, String fieldName, String indent, Formatter output, boolean useBuilder)
createDeserializer in class DataTypefield - message field.fieldName - the array message field name.indent - indent the code by this amount.output - append the code to this formatter.useBuilder - if true then fieldName
is a builder method name; otherwise a local variable.public String dataClassName()
dataClassName in class DataTypepublic DataType subtype()
Copyright © 2019. All rights reserved.