Package net.minidev.json.reader
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 serialiserstatic 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 TypeMethodDescriptionvoid
addInterfaceWriterFirst
(Class<?> interFace, JsonWriterI<?> writer) Deprecated.use registerWriterInterfaceFirstvoid
addInterfaceWriterLast
(Class<?> interFace, JsonWriterI<?> writer) Deprecated.use registerWriterInterfaceLastgetWriterByInterface
(Class<?> clazz) try to find a Writer by Checking implemented interfacevoid
init()
<T> void
registerWriter
(JsonWriterI<T> writer, Class<?>... cls) associate an Writer to a Classvoid
registerWriterInterface
(Class<?> interFace, JsonWriterI<?> writer) an alias for registerWriterInterfaceLastvoid
registerWriterInterfaceFirst
(Class<?> interFace, JsonWriterI<?> writer) associate an Writer to a interface With Hi priorityvoid
registerWriterInterfaceLast
(Class<?> interFace, JsonWriterI<?> writer) associate an Writer to a interface With Low priority<T> void
remapField
(Class<T> type, String fromJava, String toJson) remap field name in custom classesstatic void
writeJSONKV
(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 serialiserBased on ASM
-
beansWriter
Json-Smart V1 Beans serialiser -
arrayWriter
Json-Smart ArrayWriterClass -
toStringWriter
ToString Writer
-
-
Constructor Details
-
JsonWriter
public JsonWriter()
-
-
Method Details
-
remapField
remap field name in custom classes- Parameters:
fromJava
- field name in javatoJson
- field name in json- Since:
- 2.1.1
-
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
-