Top Description Methods
org.snakeyaml.engine.v2.api

public Interface ConstructNode

Known Direct Implementers
org.snakeyaml.engine.v2.constructor.ConstructScalar, org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructYamlSet, org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructYamlSeq, org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructYamlMap
Imports
org.snakeyaml.engine.v2.exceptions.YamlEngineException, org.snakeyaml.engine.v2.nodes.Node

Provide a way to construct a Java instance from the composed Node. Support recursive objects if it is required. (create Native Data Structure out of Node Graph) (this is the opposite for Represent)
See Also
Processing Overview

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a complete Java instance or empty collection instance if it is recursive
construct
(Node
composed Node
node
)

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

public default void
constructRecursive(Node
composed Node
node
,
Object
the instance constructed earlier by construct(Node node) for the provided Node
object
)

Apply the second step when constructing recursive structures.

Method Detail

constructback to summary
public Object construct(Node node)

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

Parameters
node:Node

composed Node

Returns:Object

a complete Java instance or empty collection instance if it is recursive

constructRecursiveback to summary
public default void constructRecursive(Node node, Object object)

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

Parameters
node:Node

composed Node

object:Object

the instance constructed earlier by construct(Node node) for the provided Node