Package org.yaml.snakeyaml.env
Class EnvScalarConstructor
java.lang.Object
org.yaml.snakeyaml.constructor.BaseConstructor
org.yaml.snakeyaml.constructor.SafeConstructor
org.yaml.snakeyaml.constructor.Constructor
org.yaml.snakeyaml.env.EnvScalarConstructor
Construct scalar for format ${VARIABLE} replacing the template with the value from environment.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.yaml.snakeyaml.constructor.Constructor
Constructor.ConstructMapping, Constructor.ConstructScalar, Constructor.ConstructSequence, Constructor.ConstructYamlObjectNested classes/interfaces inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
SafeConstructor.ConstructUndefined, SafeConstructor.ConstructYamlBinary, SafeConstructor.ConstructYamlBool, SafeConstructor.ConstructYamlFloat, SafeConstructor.ConstructYamlInt, SafeConstructor.ConstructYamlMap, SafeConstructor.ConstructYamlNull, SafeConstructor.ConstructYamlOmap, SafeConstructor.ConstructYamlPairs, SafeConstructor.ConstructYamlSeq, SafeConstructor.ConstructYamlSet, SafeConstructor.ConstructYamlStr, SafeConstructor.ConstructYamlTimestamp -
Field Summary
FieldsFields inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
undefinedConstructorFields inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
composer, loadingConfig, rootTag, typeDefinitions, typeTags, yamlClassConstructors, yamlConstructors, yamlMultiConstructors -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.yaml.snakeyaml.constructor.Constructor
getClassForName, getClassForNodeMethods inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
constructMapping2ndStep, constructSet2ndStep, createLongOrBigInteger, flattenMapping, processDuplicateKeysMethods inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
addTypeDescription, checkData, constructArray, constructArrayStep2, constructDocument, constructMapping, constructObject, constructObjectNoCheck, constructScalar, constructSequence, constructSequenceStep2, constructSet, constructSet, createArray, createDefaultList, createDefaultMap, createDefaultSet, finalizeConstruction, getConstructor, getData, getPropertyUtils, getSingleData, isAllowDuplicateKeys, isEnumCaseSensitive, isExplicitPropertyUtils, isWrappedToRootException, newInstance, newInstance, newInstance, newList, newMap, newSet, postponeMapFilling, postponeSetFilling, setAllowDuplicateKeys, setComposer, setEnumCaseSensitive, setPropertyUtils, setWrappedToRootException
-
Field Details
-
ENV_TAG
-
ENV_FORMAT
-
-
Constructor Details
-
EnvScalarConstructor
public EnvScalarConstructor()
-
-
Method Details
-
apply
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
Get value of the environment variable- Parameters:
key- - the name of the variable- Returns:
- value or null if not set
-