public class Constructor extends SafeConstructor
Modifier and Type | Class and 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.
|
SafeConstructor.ConstructUndefined, SafeConstructor.ConstructYamlBinary, SafeConstructor.ConstructYamlBool, SafeConstructor.ConstructYamlFloat, SafeConstructor.ConstructYamlInt, SafeConstructor.ConstructYamlMap, SafeConstructor.ConstructYamlNull, SafeConstructor.ConstructYamlNumber, SafeConstructor.ConstructYamlOmap, SafeConstructor.ConstructYamlPairs, SafeConstructor.ConstructYamlSeq, SafeConstructor.ConstructYamlSet, SafeConstructor.ConstructYamlStr, SafeConstructor.ConstructYamlTimestamp
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Class<? extends java.lang.Object>,TypeDescription> |
typeDefinitions |
private java.util.Map<Tag,java.lang.Class<? extends java.lang.Object>> |
typeTags |
undefinedConstructor
composer, rootTag, yamlClassConstructors, yamlConstructors, yamlMultiConstructors
Constructor and Description |
---|
Constructor() |
Constructor(java.lang.Class<? extends java.lang.Object> theRoot)
Create Constructor for the specified class as the root.
|
Constructor(java.lang.String theRoot)
Create Constructor for a class which does not have to be in the classpath
or for a definition from a Spring ApplicationContext.
|
Constructor(TypeDescription theRoot) |
Modifier and Type | Method and Description |
---|---|
TypeDescription |
addTypeDescription(TypeDescription definition)
Make YAML aware how to parse a custom Class.
|
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 constructor
|
protected java.lang.Class<?> |
getClassForName(java.lang.String name) |
protected java.lang.Class<?> |
getClassForNode(Node node) |
constructMapping2ndStep, constructSet2ndStep, flattenMapping
checkData, constructArray, constructArrayStep2, constructDocument, constructMapping, constructObject, constructScalar, constructSequence, constructSequenceStep2, constructSet, constructSet, createArray, createDefaultList, createDefaultMap, createDefaultSet, createDefaultSet, getConstructor, getData, getPropertyUtils, getSingleData, isExplicitPropertyUtils, setComposer, setPropertyUtils
private final java.util.Map<Tag,java.lang.Class<? extends java.lang.Object>> typeTags
protected final java.util.Map<java.lang.Class<? extends java.lang.Object>,TypeDescription> typeDefinitions
public Constructor()
public Constructor(java.lang.Class<? extends java.lang.Object> theRoot)
theRoot
- - the class (usually JavaBean) to be constructedpublic Constructor(TypeDescription theRoot)
public Constructor(java.lang.String theRoot) throws java.lang.ClassNotFoundException
theRoot
- fully qualified class name of the root class (usually
JavaBean)java.lang.ClassNotFoundException
private static java.lang.Class<? extends java.lang.Object> checkRoot(java.lang.Class<? extends java.lang.Object> theRoot)
private static final java.lang.String check(java.lang.String s)
public TypeDescription addTypeDescription(TypeDescription definition)
definition
- to be added to the Constructorprotected java.lang.Class<?> getClassForNode(Node node)
protected java.lang.Class<?> getClassForName(java.lang.String name) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException