public class ConcreteMessageType extends MessageType
abstract it references a concrete message/field
type.MessageType.MessageFieldBUILD_INNER_CLASS, BUILDER_METHOD, mFields, mReplyClasses, mSubject, PUBLIC_FINAL, PUBLIC_STATIC, SUBJECT_FIELDADDRESS_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| Modifier | Constructor and Description |
|---|---|
protected |
ConcreteMessageType(Class<?> clazz,
List<MessageType.MessageField> fields,
List<Class<? extends EReplyMessage>> replies,
Method builder,
Class<? extends EMessageObject.Builder<?,?>> bc)
Creates a new concrete message type instance.
|
| Modifier and Type | Method and Description |
|---|---|
Method |
builder()
Returns the static method which returns the message
builder instance.
|
Class<? extends EMessageObject.Builder<?,?>> |
builderClass()
Returns the message object builder class.
|
String |
builderClassName()
Returns the message builder canonical name.
|
protected void |
createDeserializer(MessageType.MessageField field,
String fieldName,
String indent,
Formatter output,
boolean useBuilder)
Returns code for de-serializing a specified field.
|
protected void |
createSerializer(MessageType.MessageField field,
String fieldName,
String indent,
Formatter output)
Returns code for serializing a specific field.
|
Object |
deserialize(ByteBuffer buffer)
Returns an
EMessageObject extracted from the given
buffer. |
void |
serialize(Object o,
ByteBuffer buffer)
Serializes the given
EMessageObject to the given
buffer. |
deserializeFields, fields, findFields, isValidReply, numberFields, replyTypes, serializeFields, subject, valuescompareTo, dataClass, dataClassName, defaultValue, equals, fields, findCharset, findType, hashCode, isArray, isBuiltin, isEnum, isInstance, isLocalOnly, isMessage, isPrimitive, replyClasses, size, toStringprotected ConcreteMessageType(Class<?> clazz, List<MessageType.MessageField> fields, List<Class<? extends EReplyMessage>> replies, Method builder, Class<? extends EMessageObject.Builder<?,?>> bc)
clazz - the message class instance.fields - the message fields.replies - reply classes associated with a request
message class. Will be an empty array for non-request
message types.builder - message builder method.bc - message builder class used for
de-serialization.public final void serialize(Object o, ByteBuffer buffer) throws BufferOverflowException
EMessageObject to the given
buffer.serialize in class DataTypeo - serialize this object.buffer - contains serialized object.BufferOverflowException - if serialized o overflows buffer.public final Object deserialize(ByteBuffer buffer) throws BufferUnderflowException, ValidationException
EMessageObject extracted from the given
buffer. This method expects the message subject to have
been previously set if the serialized object is
an EMessage.deserialize in class DataTypebuffer - extract the serialized object from this
buffer.BufferUnderflowException - if buffer contains an incomplete object
serialization.ValidationException - if the serialized object is invalid.protected void createSerializer(MessageType.MessageField field, String fieldName, String indent, Formatter output)
UnsupportedOperationException because this class
must be extended and this method overridden.createSerializer in class DataTypefield - message field.fieldName - generate serialization code for this
field.indent - indent code by this amount.output - place generated code into this formatter.UnsupportedOperationException - because this method must be overridden by a subclass.protected void createDeserializer(MessageType.MessageField field, String fieldName, String indent, Formatter output, boolean useBuilder)
UnsupportedOperationException because this
class must be extended and this method overridden.createDeserializer in class DataTypefield - message field.fieldName - generate de-serialization code for this
field.indent - indent code by this amount.output - place generated code into this formatter.useBuilder - if true store de-serialized
object in a builder; otherwise store in local variable
named fieldName.UnsupportedOperationException - because this method must be overridden by a subclass.public Method builder()
public Class<? extends EMessageObject.Builder<?,?>> builderClass()
public String builderClassName()
Copyright © 2019. All rights reserved.