public abstract class BaseRepresenter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected FlowStyle |
defaultFlowStyle
flow style for collections
|
protected ScalarStyle |
defaultScalarStyle
scalar style
|
protected RepresentToNode |
nullRepresenter
in Java 'null' is not a type.
|
protected Object |
objectToRepresent
the current object to be converted to Node
|
protected Map<Class<?>,RepresentToNode> |
parentClassRepresenters
Keep representers which match a parent of the class to be represented
|
protected Map<Object,org.snakeyaml.engine.v2.nodes.Node> |
representedObjects
Keep references of already represented instances
|
protected Map<Class<?>,RepresentToNode> |
representers
Keep representers which must match the class exactly
|
| Constructor and Description |
|---|
BaseRepresenter() |
| Modifier and Type | Method and Description |
|---|---|
protected Optional<RepresentToNode> |
findRepresenterFor(Object data)
Find the representer which is suitable to represent the internal structure of the provided
instance to a Node
|
org.snakeyaml.engine.v2.nodes.Node |
represent(Object data)
Represent the provided Java instance to a Node
|
protected org.snakeyaml.engine.v2.nodes.Node |
representData(Object data)
Find the representer and use it to create the Node from instance
|
protected org.snakeyaml.engine.v2.nodes.Node |
representMapping(org.snakeyaml.engine.v2.nodes.Tag tag,
Map<?,?> mapping,
FlowStyle flowStyle)
Create Node for the provided Map
|
protected org.snakeyaml.engine.v2.nodes.NodeTuple |
representMappingEntry(Map.Entry<?,?> entry)
Create a tuple for one key pair
|
protected org.snakeyaml.engine.v2.nodes.Node |
representScalar(org.snakeyaml.engine.v2.nodes.Tag tag,
String value)
Create Node for string using PLAIN scalar style if possible
|
protected org.snakeyaml.engine.v2.nodes.Node |
representScalar(org.snakeyaml.engine.v2.nodes.Tag tag,
String value,
ScalarStyle style)
Create Scalar Node from string
|
protected org.snakeyaml.engine.v2.nodes.Node |
representSequence(org.snakeyaml.engine.v2.nodes.Tag tag,
Iterable<?> sequence,
FlowStyle flowStyle)
Create Node
|
protected final Map<Class<?>,RepresentToNode> representers
protected RepresentToNode nullRepresenter
protected final Map<Class<?>,RepresentToNode> parentClassRepresenters
protected ScalarStyle defaultScalarStyle
protected FlowStyle defaultFlowStyle
protected final Map<Object,org.snakeyaml.engine.v2.nodes.Node> representedObjects
protected Object objectToRepresent
public org.snakeyaml.engine.v2.nodes.Node represent(Object data)
data - - Java instance to be representedprotected Optional<RepresentToNode> findRepresenterFor(Object data)
data - - the data to be serializedprotected final org.snakeyaml.engine.v2.nodes.Node representData(Object data)
data - - the sourceprotected org.snakeyaml.engine.v2.nodes.Node representScalar(org.snakeyaml.engine.v2.nodes.Tag tag,
String value,
ScalarStyle style)
tag - - the tag in Nodevalue - - the sourcestyle - - the styleprotected org.snakeyaml.engine.v2.nodes.Node representScalar(org.snakeyaml.engine.v2.nodes.Tag tag,
String value)
tag - - the tag for Nodevalue - - the surceprotected org.snakeyaml.engine.v2.nodes.Node representSequence(org.snakeyaml.engine.v2.nodes.Tag tag,
Iterable<?> sequence,
FlowStyle flowStyle)
tag - - tag to use in Nodesequence - - the sourceflowStyle - - the flow styleprotected org.snakeyaml.engine.v2.nodes.NodeTuple representMappingEntry(Map.Entry<?,?> entry)
entry - - Map entryprotected org.snakeyaml.engine.v2.nodes.Node representMapping(org.snakeyaml.engine.v2.nodes.Tag tag,
Map<?,?> mapping,
FlowStyle flowStyle)
tag - - the tag for Nodemapping - - the sourceflowStyle - - the style of NodeCopyright © 2018–2022. All rights reserved.