Package org.yaml.snakeyaml.representer
Class BaseRepresenter
- java.lang.Object
-
- org.yaml.snakeyaml.representer.BaseRepresenter
-
- Direct Known Subclasses:
Representer
public abstract class BaseRepresenter extends Object
Represent basic YAML structures: scalar, sequence, mapping
-
-
Field Summary
Fields Modifier and Type Field Description protected DumperOptions.FlowStyle
defaultFlowStyle
flow style to use if not redefined.protected DumperOptions.ScalarStyle
defaultScalarStyle
default scalar style is not definedprotected Map<Class<?>,Represent>
multiRepresenters
represent class and its children with common codeprotected Represent
nullRepresenter
in Java 'null' is not a type.protected Object
objectToRepresent
object to create the Node forprotected Map<Object,Node>
representedObjects
Keep references of already represented instancesprotected Map<Class<?>,Represent>
representers
represent the class without its subclasses
-
Constructor Summary
Constructors Constructor Description BaseRepresenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DumperOptions.FlowStyle
getDefaultFlowStyle()
getterDumperOptions.ScalarStyle
getDefaultScalarStyle()
getterPropertyUtils
getPropertyUtils()
getterboolean
isExplicitPropertyUtils()
Node
represent(Object data)
protected Node
representData(Object data)
protected Node
representMapping(Tag tag, Map<?,?> mapping, DumperOptions.FlowStyle flowStyle)
protected Node
representScalar(Tag tag, String value)
protected Node
representScalar(Tag tag, String value, DumperOptions.ScalarStyle style)
protected Node
representSequence(Tag tag, Iterable<?> sequence, DumperOptions.FlowStyle flowStyle)
void
setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle)
void
setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
void
setPropertyUtils(PropertyUtils propertyUtils)
-
-
-
Field Detail
-
representers
protected final Map<Class<?>,Represent> representers
represent the class without its subclasses
-
nullRepresenter
protected Represent nullRepresenter
in Java 'null' is not a type. So we have to keep the null representer separately otherwise it will coincide with the default representer which is stored with the key null.
-
multiRepresenters
protected final Map<Class<?>,Represent> multiRepresenters
represent class and its children with common code
-
defaultScalarStyle
protected DumperOptions.ScalarStyle defaultScalarStyle
default scalar style is not defined
-
defaultFlowStyle
protected DumperOptions.FlowStyle defaultFlowStyle
flow style to use if not redefined.
-
representedObjects
protected final Map<Object,Node> representedObjects
Keep references of already represented instances
-
objectToRepresent
protected Object objectToRepresent
object to create the Node for
-
-
Method Detail
-
representScalar
protected Node representScalar(Tag tag, String value, DumperOptions.ScalarStyle style)
-
representSequence
protected Node representSequence(Tag tag, Iterable<?> sequence, DumperOptions.FlowStyle flowStyle)
-
representMapping
protected Node representMapping(Tag tag, Map<?,?> mapping, DumperOptions.FlowStyle flowStyle)
-
setDefaultScalarStyle
public void setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
-
getDefaultScalarStyle
public DumperOptions.ScalarStyle getDefaultScalarStyle()
getter- Returns:
- scala style
-
setDefaultFlowStyle
public void setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle)
-
getDefaultFlowStyle
public DumperOptions.FlowStyle getDefaultFlowStyle()
getter- Returns:
- current flow style
-
setPropertyUtils
public void setPropertyUtils(PropertyUtils propertyUtils)
-
getPropertyUtils
public final PropertyUtils getPropertyUtils()
getter- Returns:
- utils or create if null
-
isExplicitPropertyUtils
public final boolean isExplicitPropertyUtils()
-
-