Package deltix.qsrv.util.json
Class JSONRawMessagePrinter
- java.lang.Object
-
- deltix.qsrv.util.json.JSONRawMessagePrinter
-
public class JSONRawMessagePrinter extends java.lang.Object
Formats RawMessage to JSON. Not thread safe.Usage example:
RawMessage raw = ... new JSONRawMessagePrinter().append(raw, sb); System.out.println (sb.toString());
-
-
Field Summary
Fields Modifier and Type Field Description protected DataEncoding
dataEncoding
protected boolean
htmlSafe
protected int
indent
protected boolean
prettyPrint
protected boolean
printInstrumentType
protected PrintType
printType
protected boolean
skipNull
protected java.lang.String
typeField
-
Constructor Summary
Constructors Constructor Description JSONRawMessagePrinter()
JSONRawMessagePrinter(boolean printInstrumentType)
JSONRawMessagePrinter(boolean prettyPrint, boolean skipNull, DataEncoding dataEncoding, boolean htmlSafe, boolean printInstrumentType, PrintType printType)
Deprecated.JSONRawMessagePrinter(boolean prettyPrint, boolean skipNull, DataEncoding dataEncoding, boolean htmlSafe, boolean printInstrumentType, PrintType printType, boolean printStaticFields, java.lang.String typeField)
JSONRawMessagePrinter(boolean prettyPrint, boolean skipNull, DataEncoding dataEncoding, boolean htmlSafe, boolean printInstrumentType, PrintType printType, java.lang.String typeField)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(RawMessage raw, java.lang.StringBuilder sb)
protected void
appendAlphanumeric(ReadableValue decoder, java.lang.StringBuilder sb)
protected boolean
appendArrayField(ArrayDataType type, ReadableValue udec, java.lang.StringBuilder sb)
protected void
appendBinary(byte[] bytes, java.lang.StringBuilder sb)
protected boolean
appendBinaryField(BinaryDataType type, ReadableValue udec, java.lang.StringBuilder sb)
protected void
appendBlock(char brace, java.lang.StringBuilder sb)
protected void
appendChar(char ch, java.lang.StringBuilder sb)
protected boolean
appendClassField(ReadableValue udec, java.lang.StringBuilder sb)
protected boolean
appendDecimal(long value, java.lang.StringBuilder sb)
protected boolean
appendDouble(double d, java.lang.StringBuilder sb)
protected boolean
appendEnum(ReadableValue decoder, EnumDataType type, java.lang.StringBuilder sb)
protected boolean
appendField(StaticFieldInfo field, java.lang.StringBuilder sb)
protected boolean
appendField(ReadableValue decoder, NonStaticFieldInfo field, java.lang.StringBuilder sb)
protected boolean
appendFieldValue(ReadableValue decoder, NonStaticFieldInfo field, java.lang.StringBuilder sb)
protected boolean
appendFloat(float f, java.lang.StringBuilder sb)
protected void
appendHeader(RawMessage raw, java.lang.StringBuilder sb)
protected void
appendIndent(java.lang.StringBuilder sb)
protected void
appendNanoTime(long nanoTime, java.lang.StringBuilder sb)
protected void
appendSeparator(java.lang.StringBuilder sb)
protected void
appendString(ReadableValue decoder, java.lang.StringBuilder sb, VarcharDataType dataType)
protected void
appendString(java.lang.CharSequence text, java.lang.StringBuilder sb)
protected boolean
appendTime(int timeOfDay, java.lang.StringBuilder sb)
protected boolean
appendTimestamp(long timestamp, java.lang.StringBuilder sb)
protected void
appendType(java.lang.StringBuilder sb, java.lang.String fullType)
protected void
appendValue(DataType dataType, java.lang.String value, java.lang.StringBuilder sb)
protected UnboundDecoder
getDecoder(RawMessage raw)
-
-
-
Field Detail
-
prettyPrint
protected final boolean prettyPrint
-
skipNull
protected final boolean skipNull
-
indent
protected int indent
-
dataEncoding
protected final DataEncoding dataEncoding
-
typeField
protected final java.lang.String typeField
-
htmlSafe
protected final boolean htmlSafe
-
printInstrumentType
protected final boolean printInstrumentType
-
printType
protected final PrintType printType
-
-
Constructor Detail
-
JSONRawMessagePrinter
public JSONRawMessagePrinter()
-
JSONRawMessagePrinter
public JSONRawMessagePrinter(boolean printInstrumentType)
-
JSONRawMessagePrinter
@Deprecated public JSONRawMessagePrinter(boolean prettyPrint, boolean skipNull, DataEncoding dataEncoding, boolean htmlSafe, boolean printInstrumentType, PrintType printType)
Deprecated.
-
JSONRawMessagePrinter
public JSONRawMessagePrinter(boolean prettyPrint, boolean skipNull, DataEncoding dataEncoding, boolean htmlSafe, boolean printInstrumentType, PrintType printType, java.lang.String typeField)
-
JSONRawMessagePrinter
public JSONRawMessagePrinter(boolean prettyPrint, boolean skipNull, DataEncoding dataEncoding, boolean htmlSafe, boolean printInstrumentType, PrintType printType, boolean printStaticFields, java.lang.String typeField)
-
-
Method Detail
-
append
public void append(RawMessage raw, java.lang.StringBuilder sb)
-
appendHeader
protected void appendHeader(RawMessage raw, java.lang.StringBuilder sb)
-
getDecoder
protected UnboundDecoder getDecoder(RawMessage raw)
-
appendField
protected boolean appendField(ReadableValue decoder, NonStaticFieldInfo field, java.lang.StringBuilder sb)
-
appendField
protected boolean appendField(StaticFieldInfo field, java.lang.StringBuilder sb)
-
appendValue
protected void appendValue(DataType dataType, java.lang.String value, java.lang.StringBuilder sb)
-
appendFieldValue
protected boolean appendFieldValue(ReadableValue decoder, NonStaticFieldInfo field, java.lang.StringBuilder sb)
-
appendType
protected void appendType(java.lang.StringBuilder sb, java.lang.String fullType)
-
appendClassField
protected boolean appendClassField(ReadableValue udec, java.lang.StringBuilder sb) throws NullValueException
- Throws:
NullValueException
-
appendBinaryField
protected boolean appendBinaryField(BinaryDataType type, ReadableValue udec, java.lang.StringBuilder sb) throws NullValueException
- Throws:
NullValueException
-
appendBinary
protected void appendBinary(byte[] bytes, java.lang.StringBuilder sb)
-
appendArrayField
protected boolean appendArrayField(ArrayDataType type, ReadableValue udec, java.lang.StringBuilder sb) throws NullValueException
- Throws:
NullValueException
-
appendTimestamp
protected boolean appendTimestamp(long timestamp, java.lang.StringBuilder sb)
-
appendNanoTime
protected void appendNanoTime(long nanoTime, java.lang.StringBuilder sb)
-
appendTime
protected boolean appendTime(int timeOfDay, java.lang.StringBuilder sb)
-
appendString
protected void appendString(java.lang.CharSequence text, java.lang.StringBuilder sb)
-
appendString
protected void appendString(ReadableValue decoder, java.lang.StringBuilder sb, VarcharDataType dataType)
-
appendAlphanumeric
protected void appendAlphanumeric(ReadableValue decoder, java.lang.StringBuilder sb)
-
appendChar
protected void appendChar(char ch, java.lang.StringBuilder sb)
-
appendEnum
protected boolean appendEnum(ReadableValue decoder, EnumDataType type, java.lang.StringBuilder sb)
-
appendDecimal
protected boolean appendDecimal(long value, java.lang.StringBuilder sb)
-
appendFloat
protected boolean appendFloat(float f, java.lang.StringBuilder sb)
-
appendDouble
protected boolean appendDouble(double d, java.lang.StringBuilder sb)
-
appendSeparator
protected void appendSeparator(java.lang.StringBuilder sb)
-
appendBlock
protected void appendBlock(char brace, java.lang.StringBuilder sb)
-
appendIndent
protected void appendIndent(java.lang.StringBuilder sb)
-
-