Class JsonWriter
java.lang.Object
net.minidev.json.reader.JsonWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonWriterI<Object> Json-Smart ArrayWriterClassstatic final JsonWriterI<Object> Json-Smart V1 Beans serialiserstatic final JsonWriterI<Object> Json-Smart V2 Beans serialiser Based on ASMstatic final JsonWriterI<Enum<?>> static final JsonWriterI<Iterable<? extends Object>> static final JsonWriterI<JSONAwareEx> static final JsonWriterI<JSONAware> static final JsonWriterI<Map<String, ? extends Object>> static final JsonWriterI<JSONStreamAwareEx> static final JsonWriterI<JSONStreamAwareEx> static final JsonWriterI<Object> ToString Writer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInterfaceWriterFirst(Class<?> interFace, JsonWriterI<?> writer) Deprecated.use registerWriterInterfaceFirstvoidaddInterfaceWriterLast(Class<?> interFace, JsonWriterI<?> writer) Deprecated.use registerWriterInterfaceLastgetWriterByInterface(Class<?> clazz) try to find a Writer by Checking implemented interfacevoidinit()<T> voidregisterWriter(JsonWriterI<T> writer, Class<?>... cls) associate an Writer to a ClassvoidregisterWriterInterface(Class<?> interFace, JsonWriterI<?> writer) an alias for registerWriterInterfaceLastvoidregisterWriterInterfaceFirst(Class<?> interFace, JsonWriterI<?> writer) associate an Writer to a interface With Hi priorityvoidregisterWriterInterfaceLast(Class<?> interFace, JsonWriterI<?> writer) associate an Writer to a interface With Low priority<T> voidremapField(Class<T> type, String fromJava, String toJson) remap field name in custom classesstatic voidwriteJSONKV(String key, Object value, Appendable out, JSONStyle compression) Write a Key : value entry to a stream
-
Field Details
-
JSONStreamAwareWriter
-
JSONStreamAwareExWriter
-
JSONJSONAwareExWriter
-
JSONJSONAwareWriter
-
JSONIterableWriter
-
EnumWriter
-
JSONMapWriter
-
beansWriterASM
Json-Smart V2 Beans serialiser Based on ASM -
beansWriter
Json-Smart V1 Beans serialiser -
arrayWriter
Json-Smart ArrayWriterClass -
toStringWriter
ToString Writer
-
-
Constructor Details
-
JsonWriter
public JsonWriter()
-
-
Method Details
-
remapField
-
getWriterByInterface
try to find a Writer by Checking implemented interface- Parameters:
clazz- class to serialize- Returns:
- a Writer or null
-
getWrite
-
init
public void init() -
addInterfaceWriterFirst
Deprecated.use registerWriterInterfaceFirstassociate an Writer to a interface With Hi priority- Parameters:
interFace- interface to mapwriter- writer Object
-
addInterfaceWriterLast
Deprecated.use registerWriterInterfaceLastassociate an Writer to a interface With Low priority- Parameters:
interFace- interface to mapwriter- writer Object
-
registerWriterInterfaceLast
associate an Writer to a interface With Low priority- Parameters:
interFace- interface to mapwriter- writer Object
-
registerWriterInterfaceFirst
associate an Writer to a interface With Hi priority- Parameters:
interFace- interface to mapwriter- writer Object
-
registerWriterInterface
an alias for registerWriterInterfaceLast- Parameters:
interFace- interface to mapwriter- writer Object
-
registerWriter
associate an Writer to a Class- Parameters:
writer-cls-
-
writeJSONKV
public static void writeJSONKV(String key, Object value, Appendable out, JSONStyle compression) throws IOException Write a Key : value entry to a stream- Throws:
IOException
-