Top Description Inners Fields Constructors Methods
org.snakeyaml.engine.v2.constructor

public Class StandardConstructor

extends BaseConstructor
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .Iterator, .List, .Map, .Optional, .Set, .TreeSet, java.util.regex.Matcher, org.snakeyaml.engine.v2.api.ConstructNode, .LoadSettings, org.snakeyaml.engine.v2.env.EnvConfig, org.snakeyaml.engine.v2.exceptions.ConstructorException, .DuplicateKeyException, .Mark, .MissingEnvironmentVariableException, .YamlEngineException, org.snakeyaml.engine.v2.nodes.MappingNode, .Node, .NodeTuple, .SequenceNode, .Tag, org.snakeyaml.engine.v2.resolver.JsonScalarResolver

Construct standard Java classes

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
StandardConstructor.ConstructEnv

Construct scalar for format ${VARIABLE} replacing the template with the value from environment.

public class
public class
StandardConstructor.ConstructYamlSeq

Create the List implementation (configured in setting)

public class
public class
StandardConstructor.ConstructYamlStr

Create String instances

Field Summary

Inherited from org.snakeyaml.engine.v2.constructor.BaseConstructor:
constructedObjectssettingstagConstructors

Constructor Summary

AccessConstructor and Description
public
StandardConstructor(LoadSettings
- configuration options
settings
)

Create

Method Summary

Modifier and TypeMethod and Description
private Object
constructKey(Node keyNode, Optional<Mark> contextMark, Optional<Mark> problemMark)

protected void
constructMapping2ndStep(MappingNode node, Map<Object, Object> mapping)

Overrides org.snakeyaml.engine.v2.constructor.BaseConstructor.constructMapping2ndStep.

Fill the mapping with the data from provided node

protected void
protected void
protected void
processDuplicateKeys(MappingNode
- the source
node
)

detect and process the duplicate key in mapping according to the configured setting

Inherited from org.snakeyaml.engine.v2.constructor.BaseConstructor:
constructconstructMappingconstructObjectconstructObjectNoCheckconstructScalarconstructSequenceconstructSequenceStep2constructSetconstructSingleDocumentcreateEmptyListForNodecreateEmptyMapForcreateEmptySetForNodefindConstructorForpostponeMapFillingpostponeSetFilling

Constructor Detail

StandardConstructorback to summary
public StandardConstructor(LoadSettings settings)

Create

Parameters
settings:LoadSettings

- configuration options

Method Detail

constructKeyback to summary
private Object constructKey(Node keyNode, Optional<Mark> contextMark, Optional<Mark> problemMark)
constructMapping2ndStepback to summary
protected void constructMapping2ndStep(MappingNode node, Map<Object, Object> mapping)

Overrides org.snakeyaml.engine.v2.constructor.BaseConstructor.constructMapping2ndStep.

Doc from org.snakeyaml.engine.v2.constructor.BaseConstructor.constructMapping2ndStep.

Fill the mapping with the data from provided node

Annotations
@Override
constructSet2ndStepback to summary
protected void constructSet2ndStep(MappingNode node, Set<Object> set)

Overrides org.snakeyaml.engine.v2.constructor.BaseConstructor.constructSet2ndStep.

Doc from org.snakeyaml.engine.v2.constructor.BaseConstructor.constructSet2ndStep.

Fill the Map with the data from the node

Annotations
@Override
flattenMappingback to summary
protected void flattenMapping(MappingNode node)
processDuplicateKeysback to summary
protected void processDuplicateKeys(MappingNode node)

detect and process the duplicate key in mapping according to the configured setting

Parameters
node:MappingNode

- the source

org.snakeyaml.engine.v2.constructor back to summary

public Class StandardConstructor.ConstructEnv

extends ConstructScalar
Class Inheritance

Construct scalar for format ${VARIABLE} replacing the template with the value from environment.
See Also
Variable substitution, Variable substitution

Field Summary

Inherited from org.snakeyaml.engine.v2.constructor.ConstructScalar:
BOOL_VALUES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the value to apply in the template
apply
(String
- variable name in the template
name
,
String
- separator in the template, can be :-, -, :?, ?
separator
,
String
- default value or the error in the template
value
,
String
- the value from environment for the provided variable
environment
)

Implement the logic for missing and unset variables

public Object
construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

public String

Returns:

value or null if not set
getEnv
(String
- the name of the variable
key
)

Get value of the environment variable

Inherited from org.snakeyaml.engine.v2.constructor.ConstructScalar:
constructScalar

Constructor Detail

ConstructEnvback to summary
public ConstructEnv()

Method Detail

applyback to summary
public String apply(String name, String separator, String value, String environment)

Implement the logic for missing and unset variables

Parameters
name:String

- variable name in the template

separator:String

- separator in the template, can be :-, -, :?, ?

value:String

- default value or the error in the template

environment:String

- the value from environment for the provided variable

Returns:String

the value to apply in the template

constructback to summary
public Object construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

getEnvback to summary
public String getEnv(String key)

Get value of the environment variable

Parameters
key:String

- the name of the variable

Returns:String

value or null if not set

Annotations
@SuppressWarnings:squid:S5304
org.snakeyaml.engine.v2.constructor back to summary

public Class StandardConstructor.ConstructYamlMap

extends Object
implements ConstructNode
Class Inheritance
  • java.lang.Object
  • org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructYamlMap
All Implemented Interfaces
org.snakeyaml.engine.v2.api.ConstructNode

Create Map instance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

public void
constructRecursive(Node node, Object object)

Overrides default org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Apply the second step when constructing recursive structures.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConstructYamlMapback to summary
public ConstructYamlMap()

Method Detail

constructback to summary
public Object construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

Annotations
@Override
constructRecursiveback to summary
public void constructRecursive(Node node, Object object)

Overrides default org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Apply the second step when constructing recursive structures. Because the instance is already created it can assign a reference to itself. (no need to implement this method for non-recursive data structures). Fail with a reminder to provide the second step for a recursive structure

Annotations
@Override
@SuppressWarnings:unchecked
org.snakeyaml.engine.v2.constructor back to summary

public Class StandardConstructor.ConstructYamlSeq

extends Object
implements ConstructNode
Class Inheritance
  • java.lang.Object
  • org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructYamlSeq
All Implemented Interfaces
org.snakeyaml.engine.v2.api.ConstructNode

Create the List implementation (configured in setting)

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

public void
constructRecursive(Node node, Object data)

Overrides default org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Apply the second step when constructing recursive structures.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConstructYamlSeqback to summary
public ConstructYamlSeq()

Method Detail

constructback to summary
public Object construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

Annotations
@Override
constructRecursiveback to summary
public void constructRecursive(Node node, Object data)

Overrides default org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Apply the second step when constructing recursive structures. Because the instance is already created it can assign a reference to itself. (no need to implement this method for non-recursive data structures). Fail with a reminder to provide the second step for a recursive structure

Annotations
@Override
@SuppressWarnings:unchecked
org.snakeyaml.engine.v2.constructor back to summary

public Class StandardConstructor.ConstructYamlSet

extends Object
implements ConstructNode
Class Inheritance
  • java.lang.Object
  • org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructYamlSet
All Implemented Interfaces
org.snakeyaml.engine.v2.api.ConstructNode

Create Set instances

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

public void
constructRecursive(Node node, Object object)

Overrides default org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Apply the second step when constructing recursive structures.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConstructYamlSetback to summary
public ConstructYamlSet()

Method Detail

constructback to summary
public Object construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

Annotations
@Override
constructRecursiveback to summary
public void constructRecursive(Node node, Object object)

Overrides default org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.constructRecursive.

Apply the second step when constructing recursive structures. Because the instance is already created it can assign a reference to itself. (no need to implement this method for non-recursive data structures). Fail with a reminder to provide the second step for a recursive structure

Annotations
@Override
@SuppressWarnings:unchecked
org.snakeyaml.engine.v2.constructor back to summary

public Class StandardConstructor.ConstructYamlStr

extends ConstructScalar
Class Inheritance

Create String instances

Field Summary

Inherited from org.snakeyaml.engine.v2.constructor.ConstructScalar:
BOOL_VALUES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

Inherited from org.snakeyaml.engine.v2.constructor.ConstructScalar:
constructScalar

Constructor Detail

ConstructYamlStrback to summary
public ConstructYamlStr()

Method Detail

constructback to summary
public Object construct(Node node)

Implements org.snakeyaml.engine.v2.api.ConstructNode.construct.

Doc from org.snakeyaml.engine.v2.api.ConstructNode.construct.

Construct a Java instance with all the properties injected when it is possible.

Annotations
@Override