Class BaseRepresenter
java.lang.Object
org.snakeyaml.engine.v2.representer.BaseRepresenter
- Direct Known Subclasses:
StandardRepresenter
Represent basic YAML structures: scalar, sequence, mapping
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FlowStyleflow style for collectionsprotected ScalarStylescalar styleprotected RepresentToNodein Java 'null' is not a type.protected Objectthe current object to be converted to Nodeprotected final Map<Class<?>, RepresentToNode> Keep representers which match a parent of the class to be representedKeep references of already represented instances.protected final Map<Class<?>, RepresentToNode> Keep representers which must match the class exactly -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<RepresentToNode> findRepresenterFor(Object data) Find the representer which is suitable to represent the internal structure of the provided instance to a NodeRepresent the provided Java instance to a Nodeprotected final NoderepresentData(Object data) Find the representer and use it to create the Node from instanceprotected NoderepresentMapping(Tag tag, Map<?, ?> mapping, FlowStyle flowStyle) Create Node for the provided Mapprotected NodeTuplerepresentMappingEntry(Map.Entry<?, ?> entry) Create a tuple for one key pairprotected NoderepresentScalar(Tag tag, String value) Create Node for string using PLAIN scalar style if possibleprotected NoderepresentScalar(Tag tag, String value, ScalarStyle style) Create Scalar Node from stringprotected NoderepresentSequence(Tag tag, Iterable<?> sequence, FlowStyle flowStyle) Create Node
-
Field Details
-
representers
Keep representers which must match the class exactly -
parentClassRepresenters
Keep representers which match a parent of the class to be represented -
representedObjects
-
nullRepresenter
in Java 'null' is not a type. So we have to keep the null representer separately -
defaultScalarStyle
scalar style -
defaultFlowStyle
flow style for collections -
objectToRepresent
the current object to be converted to Node
-
-
Constructor Details
-
BaseRepresenter
public BaseRepresenter()
-
-
Method Details
-
represent
-
findRepresenterFor
Find the representer which is suitable to represent the internal structure of the provided instance to a Node- Parameters:
data- - the data to be serialized- Returns:
- RepresentToNode to call to create a Node
-
representData
-
representScalar
Create Scalar Node from string- Parameters:
tag- - the tag in Nodevalue- - the sourcestyle- - the style- Returns:
- Node for string
-
representScalar
-
representSequence
-
representMappingEntry
-
representMapping
-