Class IItemCollectionJsonSerializer
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.serializers.json.IItemCollectionJsonSerializer
-
public class IItemCollectionJsonSerializer extends Object
Utility methods to convert an IItemCollection to a JSON object containing the serialised array of events.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()protected intgetColumn()voidindent()protected voidnextElement(boolean first)protected voidnextField(boolean first, String fieldName)voidretract()protected Stringstringify(Object value)protected Stringstringify(String indent, Object value)protected Stringstringify(String indent, Object value, boolean formatValues)protected StringstringifyMethod(IMCMethod method)static StringtoJsonString(Iterable<IItem> items)static StringtoJsonString(IItemCollection items)voidwrite(char c)voidwrite(int value)voidwrite(String text)voidwrite(String... texts)protected voidwriteArrayBegin()protected voidwriteArrayEnd()voidwriteAsString(Object o)protected voidwriteField(boolean first, String fieldName, Object value)protected booleanwriteIfNull(Object value)voidwriteIndent()voidwriteln()voidwriteln(String text)protected voidwriteNull()protected voidwriteObjectBegin()protected voidwriteObjectEnd()protected voidwriteStringValue(String value)
-
-
-
Method Detail
-
toJsonString
public static String toJsonString(IItemCollection items)
-
nextElement
protected void nextElement(boolean first)
-
nextField
protected void nextField(boolean first, String fieldName)
-
writeIfNull
protected boolean writeIfNull(Object value)
-
writeNull
protected void writeNull()
-
writeObjectBegin
protected void writeObjectBegin()
-
writeObjectEnd
protected void writeObjectEnd()
-
writeArrayEnd
protected void writeArrayEnd()
-
writeArrayBegin
protected void writeArrayBegin()
-
writeStringValue
protected void writeStringValue(String value)
-
getColumn
protected final int getColumn()
-
flush
public final void flush() throws IOException- Throws:
IOException
-
writeIndent
public final void writeIndent()
-
writeln
public final void writeln()
-
write
public final void write(String... texts)
-
writeAsString
public final void writeAsString(Object o)
-
write
public final void write(String text)
-
write
public final void write(char c)
-
write
public final void write(int value)
-
indent
public final void indent()
-
retract
public final void retract()
-
writeln
public final void writeln(String text)
-
-