Package org.yaml.snakeyaml.constructor
Class Constructor
- java.lang.Object
-
- org.yaml.snakeyaml.constructor.BaseConstructor
-
- org.yaml.snakeyaml.constructor.SafeConstructor
-
- org.yaml.snakeyaml.constructor.Constructor
-
- Direct Known Subclasses:
CompactConstructor
,CustomClassLoaderConstructor
,EnvScalarConstructor
public class Constructor extends SafeConstructor
Construct a custom Java instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Constructor.ConstructMapping
Construct mapping instance (Map, JavaBean) when the runtime class is known.protected class
Constructor.ConstructScalar
Construct scalar instance when the runtime class is known.protected class
Constructor.ConstructSequence
Construct sequence (List, Array, or immutable object) when the runtime class is known.protected class
Constructor.ConstructYamlObject
Construct an instance when the runtime class is not known but a global tag with a class name is defined.-
Nested 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
-
Fields inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
undefinedConstructor
-
Fields inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
composer, constructedObjects, loadingConfig, NOT_INSTANTIATED_OBJECT, rootTag, typeDefinitions, typeTags, yamlClassConstructors, yamlConstructors, yamlMultiConstructors
-
-
Constructor Summary
Constructors Constructor Description Constructor(java.lang.Class<? extends java.lang.Object> theRoot, LoaderOptions loadingConfig)
CreateConstructor(java.lang.String theRoot, LoaderOptions loadingConfig)
CreateConstructor(LoaderOptions loadingConfig)
Create with optionsConstructor(TypeDescription theRoot, java.util.Collection<TypeDescription> moreTDs, LoaderOptions loadingConfig)
Create with all possible argumentsConstructor(TypeDescription theRoot, LoaderOptions loadingConfig)
Create
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
check(java.lang.String s)
private static java.lang.Class<? extends java.lang.Object>
checkRoot(java.lang.Class<? extends java.lang.Object> theRoot)
Ugly Java way to check the argument in the constructorprotected java.lang.Class<?>
getClassForName(java.lang.String name)
protected java.lang.Class<?>
getClassForNode(Node node)
-
Methods inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
constructMapping2ndStep, constructSet2ndStep, createLongOrBigInteger, flattenMapping, flattenMapping, processDuplicateKeys, processDuplicateKeys
-
Methods 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, getLoadingConfig, getPropertyUtils, getSingleData, isAllowDuplicateKeys, isEnumCaseSensitive, isExplicitPropertyUtils, isWrappedToRootException, newInstance, newInstance, newInstance, newList, newMap, newSet, postponeMapFilling, postponeSetFilling, setAllowDuplicateKeys, setComposer, setEnumCaseSensitive, setPropertyUtils, setWrappedToRootException
-
-
-
-
Constructor Detail
-
Constructor
public Constructor(LoaderOptions loadingConfig)
Create with options- Parameters:
loadingConfig
- - config
-
Constructor
public Constructor(java.lang.Class<? extends java.lang.Object> theRoot, LoaderOptions loadingConfig)
Create- Parameters:
theRoot
- - the class to create (to be the root of the YAML document)loadingConfig
- - options
-
Constructor
public Constructor(TypeDescription theRoot, LoaderOptions loadingConfig)
Create- Parameters:
theRoot
- - the root class to createloadingConfig
- options
-
Constructor
public Constructor(TypeDescription theRoot, java.util.Collection<TypeDescription> moreTDs, LoaderOptions loadingConfig)
Create with all possible arguments- Parameters:
theRoot
- - the class (usually JavaBean) to be constructedmoreTDs
- - collection of classes used by the root classloadingConfig
- - configuration
-
Constructor
public Constructor(java.lang.String theRoot, LoaderOptions loadingConfig) throws java.lang.ClassNotFoundException
Create- Parameters:
theRoot
- - the main class to crateloadingConfig
- - options- Throws:
java.lang.ClassNotFoundException
- if something goes wrong
-
-
Method Detail
-
checkRoot
private static java.lang.Class<? extends java.lang.Object> checkRoot(java.lang.Class<? extends java.lang.Object> theRoot)
Ugly Java way to check the argument in the constructor
-
check
private static java.lang.String check(java.lang.String s)
-
getClassForNode
protected java.lang.Class<?> getClassForNode(Node node)
-
getClassForName
protected java.lang.Class<?> getClassForName(java.lang.String name) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
-