Package jodd.json
Class JsonContext
java.lang.Object
jodd.json.JsonWriter
jodd.json.JsonContext
JSON context used during serialization for building the JSON string.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<JsonValueContext> protected intprotected final booleanprotected final booleanprotected final JsonSerializerprotected JsonValueContextprotected final Pathprotected final Function<Object, TypeJsonSerializer> Fields inherited from class jodd.json.JsonWriter
isPushed, out, pushedComma, pushedName, strictStringEncoding -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturnsJsonSerializer.getPath()Returns current path.booleanbooleanReturnstrueifnullvalues have to be excluded.booleanmatchIgnoredPropertyTypes(Class propertyType, boolean excludeMaps, boolean include) Matches property types that are ignored by default.booleanmatchPathToQueries(boolean include) Matched current path to queries.Returns currentvalue context.voidpopValue()Removes object from current bag, indicating it is not anymore in the path.voidStores name to temporary stack.booleanReturnstrueif object has been already processed during the serialization.booleanSerializes the object usingtype serializer.voidWrites comma.Methods inherited from class jodd.json.JsonWriter
isNamePopped, popName, unicode, write, write, writeCloseArray, writeCloseObject, writeName, writeNumber, writeOpenArray, writeOpenObject, writeString
-
Field Details
-
jsonSerializer
-
bag
-
bagSize
protected int bagSize -
path
-
excludeNulls
protected final boolean excludeNulls -
excludeEmpty
protected final boolean excludeEmpty -
serializerResolver
-
lastValueContext
-
-
Constructor Details
-
JsonContext
-
-
Method Details
-
getJsonSerializer
ReturnsJsonSerializer. -
isExcludeNulls
public boolean isExcludeNulls()Returnstrueifnullvalues have to be excluded. -
isExcludeEmpty
public boolean isExcludeEmpty() -
pushValue
Returnstrueif object has been already processed during the serialization. Used to prevent circular dependencies. Objects are matched by identity. -
popValue
public void popValue()Removes object from current bag, indicating it is not anymore in the path. -
peekValueContext
-
getPath
Returns current path. -
pushName
Stores name to temporary stack. Used when name's value may or may not be serialized (e.g. it may be excluded), in that case we do not need to write the name.- Overrides:
pushNamein classJsonWriter
-
writeComma
public void writeComma()Writes comma.- Overrides:
writeCommain classJsonWriter
-
serialize
Serializes the object usingtype serializer. Returnstrueif object was written, otherwise returnsfalse. -
matchIgnoredPropertyTypes
Matches property types that are ignored by default. -
matchPathToQueries
public boolean matchPathToQueries(boolean include) Matched current path to queries. If match is found, provided include value may be changed.
-