Package org.yaml.snakeyaml.representer
Class JsonRepresenter
- java.lang.Object
-
- org.yaml.snakeyaml.representer.BaseRepresenter
-
- org.yaml.snakeyaml.representer.Representer
-
- org.yaml.snakeyaml.representer.JsonRepresenter
-
public class JsonRepresenter extends Representer
Represent data structures into Nodes in the way suitable for serialisation as JSON
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classJsonRepresenter.RepresentByteArrayJSON does not have support for binary data.protected classJsonRepresenter.RepresentDateUse the provided serialisation but emit as string-
Nested classes/interfaces inherited from class org.yaml.snakeyaml.representer.Representer
Representer.RepresentJavaBean
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<? extends Object>,Tag>classTagsprotected DumperOptions.NonPrintableStylenonPrintableStyleprotected TimeZonetimeZone-
Fields inherited from class org.yaml.snakeyaml.representer.Representer
typeDefinitions
-
Fields inherited from class org.yaml.snakeyaml.representer.BaseRepresenter
defaultFlowStyle, defaultScalarStyle, multiRepresenters, nullRepresenter, objectToRepresent, representedObjects, representers
-
-
Constructor Summary
Constructors Constructor Description JsonRepresenter(DumperOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TagaddClassTag(Class<? extends Object> clazz, Tag tag)Define a tag for theClassto serialize.protected TaggetTag(Class<?> clazz, Tag defaultTag)TimeZonegetTimeZone()voidsetTimeZone(TimeZone timeZone)-
Methods inherited from class org.yaml.snakeyaml.representer.Representer
addTypeDescription, checkGlobalTag, getProperties, representJavaBean, representJavaBeanProperty, setPropertyUtils
-
Methods inherited from class org.yaml.snakeyaml.representer.BaseRepresenter
getDefaultFlowStyle, getDefaultScalarStyle, getPropertyUtils, isExplicitPropertyUtils, represent, representData, representMapping, representScalar, representScalar, representSequence, setDefaultFlowStyle, setDefaultScalarStyle
-
-
-
-
Constructor Detail
-
JsonRepresenter
public JsonRepresenter(DumperOptions options)
-
-
Method Detail
-
addClassTag
public Tag addClassTag(Class<? extends Object> clazz, Tag tag)
Define a tag for theClassto serialize.- Parameters:
clazz-Classwhich tag is changedtag- new tag to be used for every instance of the specifiedClass- Returns:
- the previous tag associated with the
Class
-
getTimeZone
public TimeZone getTimeZone()
-
setTimeZone
public void setTimeZone(TimeZone timeZone)
-
-