public class MessageStringField extends MessageField<MessageFieldTypeString>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NULL_STRING |
static char |
STRING_LIMITER |
CONTENT_SEPARATOR, FIELD_SEPARATOR, STRUCTURE_SEPARATOR
Constructor and Description |
---|
MessageStringField(java.lang.String fieldname,
java.lang.String fieldcontent) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFieldcontent() |
java.lang.String |
serializepayload(java.lang.String contextstring) |
static java.lang.String |
serializeStringPayload(java.lang.String content,
java.lang.String contextstring)
Will serialize a String, managing the string delimiters and escape characters.
|
getFieldName, serialize
toString
public static final char STRING_LIMITER
public static final java.lang.String NULL_STRING
public MessageStringField(java.lang.String fieldname, java.lang.String fieldcontent)
fieldname
- name of the field (to be checked at parsing time)fieldcontent
- payload (java string)public java.lang.String getFieldcontent()
public java.lang.String serializepayload(java.lang.String contextstring)
serializepayload
in class MessageField<MessageFieldTypeString>
contextstring
- a string that will be included in the exception in case
of errorpublic static java.lang.String serializeStringPayload(java.lang.String content, java.lang.String contextstring)
content
- the string to serializecontextstring
- context of calling this helper function (this is used
for providing context to a potential excception