Top Description Fields Constructors Methods
org.yaml.snakeyaml.representer

public abstract Class BaseRepresenter

extends Object
Class Inheritance
Known Direct Subclasses
org.yaml.snakeyaml.representer.SafeRepresenter
Imports
java.util.ArrayList, .HashMap, .IdentityHashMap, .LinkedHashMap, .List, .Map, org.yaml.snakeyaml.DumperOptions, .DumperOptions.FlowStyle, .DumperOptions.ScalarStyle, org.yaml.snakeyaml.introspector.PropertyUtils, org.yaml.snakeyaml.nodes.AnchorNode, .MappingNode, .Node, .NodeTuple, .ScalarNode, .SequenceNode, .Tag

Represent basic YAML structures: scalar, sequence, mapping

Field Summary

Modifier and TypeField and Description
protected DumperOptions.FlowStyle
defaultFlowStyle

flow style to use if not redefined.

protected DumperOptions.ScalarStyle
defaultScalarStyle

default scalar style is PLAIN

private boolean
protected final Map<Class<?>, Represent>
multiRepresenters

represent class and its children with common code

protected Represent
nullRepresenter

in Java 'null' is not a type.

protected Object
objectToRepresent

object to create the Node for

private PropertyUtils
protected final Map<Object, Node>
representedObjects

Keep references of already represented instances

protected final Map<Class<?>, Represent>
representers

represent the class without its subclasses

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DumperOptions.FlowStyle

Returns:

current flow style
getDefaultFlowStyle
()

getter

public DumperOptions.ScalarStyle

Returns:

scala style
getDefaultScalarStyle
()

getter

public final PropertyUtils

Returns:

utils or create if null
getPropertyUtils
()

getter

public final boolean
public Node
protected final Node
protected Node
representMapping(Tag tag, Map<?, ?> mapping, DumperOptions.FlowStyle flowStyle)

protected Node
protected Node
protected Node
representSequence(Tag tag, Iterable<?> sequence, DumperOptions.FlowStyle flowStyle)

public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultFlowStyleback to summary
protected DumperOptions.FlowStyle defaultFlowStyle

flow style to use if not redefined.

defaultScalarStyleback to summary
protected DumperOptions.ScalarStyle defaultScalarStyle

default scalar style is PLAIN

explicitPropertyUtilsback to summary
private boolean explicitPropertyUtils
multiRepresentersback to summary
protected final Map<Class<?>, Represent> multiRepresenters

represent class and its children with common code

nullRepresenterback to summary
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.

objectToRepresentback to summary
protected Object objectToRepresent

object to create the Node for

propertyUtilsback to summary
private PropertyUtils propertyUtils
representedObjectsback to summary
protected final Map<Object, Node> representedObjects

Keep references of already represented instances

representersback to summary
protected final Map<Class<?>, Represent> representers

represent the class without its subclasses

Constructor Detail

BaseRepresenterback to summary
public BaseRepresenter()

Method Detail

getDefaultFlowStyleback to summary
public DumperOptions.FlowStyle getDefaultFlowStyle()

getter

Returns:DumperOptions.FlowStyle

current flow style

getDefaultScalarStyleback to summary
public DumperOptions.ScalarStyle getDefaultScalarStyle()

getter

Returns:DumperOptions.ScalarStyle

scala style

getPropertyUtilsback to summary
public final PropertyUtils getPropertyUtils()

getter

Returns:PropertyUtils

utils or create if null

isExplicitPropertyUtilsback to summary
public final boolean isExplicitPropertyUtils()
representback to summary
public Node represent(Object data)
representDataback to summary
protected final Node representData(Object data)
representMappingback to summary
protected Node representMapping(Tag tag, Map<?, ?> mapping, DumperOptions.FlowStyle flowStyle)
representScalarback to summary
protected Node representScalar(Tag tag, String value, DumperOptions.ScalarStyle style)
representScalarback to summary
protected Node representScalar(Tag tag, String value)
representSequenceback to summary
protected Node representSequence(Tag tag, Iterable<?> sequence, DumperOptions.FlowStyle flowStyle)
setDefaultFlowStyleback to summary
public void setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle)
setDefaultScalarStyleback to summary
public void setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
setPropertyUtilsback to summary
public void setPropertyUtils(PropertyUtils propertyUtils)