public abstract class MessageField<E extends MessageFieldType> extends MessageElement
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CONTENT_SEPARATOR |
protected static java.lang.String |
FIELD_SEPARATOR |
protected static java.lang.String |
STRUCTURE_SEPARATOR |
Constructor and Description |
---|
MessageField(java.lang.String fieldname)
Creates a new MessageField
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFieldName() |
java.lang.String |
serialize(java.lang.String padding,
boolean firstattribute)
A field is serialized with
':' (column) if first field, ',' (comma) if second or later field
the field name
'=' (equal)
payload (detailed in each subclass)
|
abstract java.lang.String |
serializepayload(java.lang.String contextstring) |
toString
protected static final java.lang.String CONTENT_SEPARATOR
protected static final java.lang.String FIELD_SEPARATOR
protected static final java.lang.String STRUCTURE_SEPARATOR
public MessageField(java.lang.String fieldname)
fieldname
- the field name, assumed to be checked by the receiver for
consistency.public java.lang.String getFieldName()
public java.lang.String serialize(java.lang.String padding, boolean firstattribute)
serialize
in class MessageElement
firstattribute
- indicates if this element if the first attribute inside
the structure If not, it is expected that the
serialization print a separator (comma)public abstract java.lang.String serializepayload(java.lang.String contextstring)
contextstring
- a string that will be included in the exception in case
of error