Class StandardConstructor.ConstructEnv
- java.lang.Object
-
- org.snakeyaml.engine.v2.constructor.ConstructScalar
-
- org.snakeyaml.engine.v2.constructor.StandardConstructor.ConstructEnv
-
- All Implemented Interfaces:
ConstructNode
- Enclosing class:
- StandardConstructor
public class StandardConstructor.ConstructEnv extends ConstructScalar
Construct scalar for format ${VARIABLE} replacing the template with the value from environment.- See Also:
- Variable substitution, Variable substitution
-
-
Field Summary
-
Fields inherited from class org.snakeyaml.engine.v2.constructor.ConstructScalar
BOOL_VALUES
-
-
Constructor Summary
Constructors Constructor Description ConstructEnv()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
apply(java.lang.String name, java.lang.String separator, java.lang.String value, java.lang.String environment)
Implement the logic for missing and unset variablesjava.lang.Object
construct(Node node)
Construct a Java instance with all the properties injected when it is possible.java.lang.String
getEnv(java.lang.String key)
Get value of the environment variable-
Methods inherited from class org.snakeyaml.engine.v2.constructor.ConstructScalar
constructScalar
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.snakeyaml.engine.v2.api.ConstructNode
constructRecursive
-
-
-
-
Method Detail
-
construct
public java.lang.Object construct(Node node)
Description copied from interface:ConstructNode
Construct a Java instance with all the properties injected when it is possible.- Parameters:
node
- composed Node- Returns:
- a complete Java instance or empty collection instance if it is recursive
-
apply
public java.lang.String apply(java.lang.String name, java.lang.String separator, java.lang.String value, java.lang.String environment)
Implement the logic for missing and unset variables- Parameters:
name
- - variable name in the templateseparator
- - separator in the template, can be :-, -, :?, ?value
- - default value or the error in the templateenvironment
- - the value from environment for the provided variable- Returns:
- the value to apply in the template
-
getEnv
public java.lang.String getEnv(java.lang.String key)
Get value of the environment variable- Parameters:
key
- - the name of the variable- Returns:
- value or null if not set
-
-