Class BaseConstructor
- java.lang.Object
-
- org.snakeyaml.engine.v2.constructor.BaseConstructor
-
- Direct Known Subclasses:
StandardConstructor
public abstract class BaseConstructor extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected LoadSettingssettingsprotected Map<Tag,ConstructNode>tagConstructorsIt maps the (explicit or implicit) tag to the Construct implementation.
-
Constructor Summary
Constructors Constructor Description BaseConstructor(LoadSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Objectconstruct(Node node)Construct complete YAML document.protected Map<Object,Object>constructMapping(MappingNode node)protected voidconstructMapping2ndStep(MappingNode node, Map<Object,Object> mapping)protected ObjectconstructObject(Node node)Construct object from the specified Node.protected ObjectconstructObjectNoCheck(Node node)protected StringconstructScalar(ScalarNode node)protected List<Object>constructSequence(SequenceNode node)protected voidconstructSequenceStep2(SequenceNode node, Collection<Object> collection)protected Set<Object>constructSet(MappingNode node)protected voidconstructSet2ndStep(MappingNode node, Set<Object> set)ObjectconstructSingleDocument(Optional<Node> optionalNode)Ensure that the stream contains a single document and construct itprotected ObjectcreateArray(Class<?> type, int size)protected List<Object>createDefaultList(int initSize)protected Map<Object,Object>createDefaultMap(int initSize)protected Set<Object>createDefaultSet(int initSize)protected Optional<ConstructNode>findConstructorFor(Node node)protected voidpostponeMapFilling(Map<Object,Object> mapping, Object key, Object value)protected voidpostponeSetFilling(Set<Object> set, Object key)
-
-
-
Field Detail
-
settings
protected LoadSettings settings
-
tagConstructors
protected final Map<Tag,ConstructNode> tagConstructors
It maps the (explicit or implicit) tag to the Construct implementation.
-
-
Constructor Detail
-
BaseConstructor
public BaseConstructor(LoadSettings settings)
-
-
Method Detail
-
constructSingleDocument
public Object constructSingleDocument(Optional<Node> optionalNode)
Ensure that the stream contains a single document and construct it- Parameters:
optionalNode- - composed Node- Returns:
- constructed instance
-
construct
protected Object construct(Node node)
Construct complete YAML document. Call the second step in case of recursive structures. At the end cleans all the state.- Parameters:
node- root Node- Returns:
- Java instance
-
constructObject
protected Object constructObject(Node node)
Construct object from the specified Node. Return existing instance if the node is already constructed.- Parameters:
node- Node to be constructed- Returns:
- Java instance
-
findConstructorFor
protected Optional<ConstructNode> findConstructorFor(Node node)
- Parameters:
node-Nodeto construct an instance from- Returns:
ConstructNodeimplementation for the specified node
-
constructScalar
protected String constructScalar(ScalarNode node)
-
constructSequence
protected List<Object> constructSequence(SequenceNode node)
-
constructSequenceStep2
protected void constructSequenceStep2(SequenceNode node, Collection<Object> collection)
-
constructSet
protected Set<Object> constructSet(MappingNode node)
-
constructMapping
protected Map<Object,Object> constructMapping(MappingNode node)
-
constructMapping2ndStep
protected void constructMapping2ndStep(MappingNode node, Map<Object,Object> mapping)
-
postponeMapFilling
protected void postponeMapFilling(Map<Object,Object> mapping, Object key, Object value)
-
constructSet2ndStep
protected void constructSet2ndStep(MappingNode node, Set<Object> set)
-
-