public final class FieldListType extends DataType
EFieldList
. The serialized field list format is:
Position | Size (bytes) | Description |
---|---|---|
0 | 2 | Message list size |
2 | m | field class name |
2+m | n | Each EField in list |
Field lists are always variable-sized since there is no way to know what field types are contained in the list at compile time. Therefore eBus messages containing field lists are variable-sized.
ADDRESS_TYPE, ARRAY_SUFFIX, CLASS_TYPE, DEFAULT_CHARSET, EMPTY_STRING, FIELD_MASK_SIZE, INDENT, INDENT1, KEY_TYPE, MAX_ARRAY_SIZE, MAX_BIG_INTEGER_SIZE, MAX_CLASS_NAME_LENGTH, MAX_FIELDS, MAX_FILE_NAME_LENGTH, MAX_STRING_LENGTH, MAX_ZONE_ID_LENGTH, mBuiltinFlag, mClass, mDefaultValue, mIsFixedSize, mSize, sClasses, sCompiledClasses, sTextTypes, STRING_TYPE, sVariableTypes, VARIABLE_SIZE
Modifier and Type | Method and Description |
---|---|
protected void |
createDeserializer(MessageType.MessageField field,
java.lang.String fieldName,
java.lang.String indent,
java.util.Formatter output,
boolean useBuilder)
Adds the Java code used to de-serialize a field list
from a
ByteBuffer . |
protected void |
createSerializer(MessageType.MessageField field,
java.lang.String fieldName,
java.lang.String indent,
java.util.Formatter output)
Adds the Java code used to serialize a field list to a
ByteBuffer . |
java.lang.Object |
deserialize(MessageType.MessageField field,
java.nio.ByteBuffer buffer)
Returns the field list instance de-serialized from the
given buffer.
|
void |
serialize(java.lang.Object o,
MessageType.MessageField field,
java.nio.ByteBuffer buffer)
Serializes the
EFieldList instance to
buffer . |
compareTo, dataClass, dataClassName, defaultValue, equals, fields, findCharset, findType, hashCode, isArray, isBoolean, isBoolean, isBuiltin, isEnum, isField, isFixedSize, isInstance, isLocalOnly, isMessage, isPrimitive, maxAllowedTextSize, replyClasses, size, toString
public void serialize(@Nullable java.lang.Object o, MessageType.MessageField field, java.nio.ByteBuffer buffer)
EFieldList
instance to
buffer
. The serialize format is show in
EFieldListType
class documentation.serialize
in class DataType
o
- a EFieldList
instance. May be
null
.field
- contains external information needed to
serialize this message field.buffer
- write output to this buffer.java.nio.BufferOverflowException
- if buffer
does not have sufficient space to store
the serialized message list.deserialize(net.sf.eBus.messages.type.MessageType.MessageField, java.nio.ByteBuffer)
public java.lang.Object deserialize(MessageType.MessageField field, java.nio.ByteBuffer buffer)
deserialize
in class DataType
field
- contains information needed to de-serialize
this message field.buffer
- read in the field list instance from this
buffer.DeserializeException
- if encode field list size is either < zero or
> maximum allowed size.java.nio.BufferUnderflowException
- if buffer
contains an incomplete field list.serialize(java.lang.Object, net.sf.eBus.messages.type.MessageType.MessageField, java.nio.ByteBuffer)
protected void createSerializer(MessageType.MessageField field, java.lang.String fieldName, java.lang.String indent, java.util.Formatter output)
ByteBuffer
.createSerializer
in class DataType
field
- message field.fieldName
- field list field name.indent
- indent the code by this white space.output
- write the code to this formatter.protected void createDeserializer(MessageType.MessageField field, java.lang.String fieldName, java.lang.String indent, java.util.Formatter output, boolean useBuilder)
ByteBuffer
.createDeserializer
in class DataType
field
- message field.fieldName
- field list field name.indent
- indent code by this white space.output
- write the code to this formatter.useBuilder
- if true
then fieldName
is a builder method name; otherwise a local variable.Copyright © 2001 - 2024. Charles W. Rapp. All rights reserved.