public class JsonContext extends JsonWriter
Modifier and Type | Field and Description |
---|---|
protected java.util.List<JsonValueContext> |
bag |
protected int |
bagSize |
protected boolean |
excludeEmpty |
protected boolean |
excludeNulls |
protected JsonSerializer |
jsonSerializer |
protected JsonValueContext |
lastValueContext |
protected Path |
path |
protected java.util.function.Function<java.lang.Object,TypeJsonSerializer> |
serializerResolver |
isPushed, out, pushedComma, pushedName, strictStringEncoding
Constructor and Description |
---|
JsonContext(JsonSerializer jsonSerializer,
java.lang.Appendable appendable) |
Modifier and Type | Method and Description |
---|---|
JsonSerializer |
getJsonSerializer()
Returns
JsonSerializer . |
Path |
getPath()
Returns current path.
|
boolean |
isExcludeEmpty() |
boolean |
isExcludeNulls()
Returns
true if null values have to be excluded. |
boolean |
matchIgnoredPropertyTypes(java.lang.Class propertyType,
boolean excludeMaps,
boolean include)
Matches property types that are ignored by default.
|
boolean |
matchPathToQueries(boolean include)
Matched current path to queries.
|
JsonValueContext |
peekValueContext()
Returns current
value context . |
void |
popValue()
Removes object from current bag, indicating it is not anymore in the path.
|
void |
pushName(java.lang.String name,
boolean withComma)
Stores name to temporary stack.
|
boolean |
pushValue(java.lang.Object value)
Returns
true if object has been already processed during the serialization. |
boolean |
serialize(java.lang.Object object)
Serializes the object using
type serializer . |
void |
writeComma()
Writes comma.
|
isNamePopped, popName, unicode, write, write, writeCloseArray, writeCloseObject, writeName, writeNumber, writeOpenArray, writeOpenObject, writeString
protected final JsonSerializer jsonSerializer
protected final java.util.List<JsonValueContext> bag
protected int bagSize
protected final Path path
protected final boolean excludeNulls
protected final boolean excludeEmpty
protected final java.util.function.Function<java.lang.Object,TypeJsonSerializer> serializerResolver
protected JsonValueContext lastValueContext
public JsonContext(JsonSerializer jsonSerializer, java.lang.Appendable appendable)
public JsonSerializer getJsonSerializer()
JsonSerializer
.public boolean isExcludeNulls()
true
if null
values have to be excluded.public boolean isExcludeEmpty()
public boolean pushValue(java.lang.Object value)
true
if object has been already processed during the serialization.
Used to prevent circular dependencies. Objects are matched by identity.public void popValue()
public JsonValueContext peekValueContext()
public Path getPath()
public void pushName(java.lang.String name, boolean withComma)
pushName
in class JsonWriter
public void writeComma()
writeComma
in class JsonWriter
public boolean serialize(java.lang.Object object)
type serializer
.
Returns true
if object was written, otherwise returns false
.public boolean matchIgnoredPropertyTypes(java.lang.Class propertyType, boolean excludeMaps, boolean include)
public boolean matchPathToQueries(boolean include)
Copyright © 2003-present Jodd Team