Class CompactConstructor
- java.lang.Object
-
- org.yaml.snakeyaml.constructor.BaseConstructor
-
- org.yaml.snakeyaml.constructor.SafeConstructor
-
- org.yaml.snakeyaml.constructor.Constructor
-
- org.yaml.snakeyaml.extensions.compactnotation.CompactConstructor
-
- Direct Known Subclasses:
PackageCompactConstructor
public class CompactConstructor extends Constructor
Construct a custom Java instance out of a compact object notation format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCompactConstructor.ConstructCompactObject-
Nested classes/interfaces inherited from class org.yaml.snakeyaml.constructor.Constructor
Constructor.ConstructMapping, Constructor.ConstructScalar, Constructor.ConstructSequence, Constructor.ConstructYamlObject
-
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.ConstructYamlNumber, SafeConstructor.ConstructYamlOmap, SafeConstructor.ConstructYamlPairs, SafeConstructor.ConstructYamlSeq, SafeConstructor.ConstructYamlSet, SafeConstructor.ConstructYamlStr, SafeConstructor.ConstructYamlTimestamp
-
-
Field Summary
-
Fields inherited from class org.yaml.snakeyaml.constructor.Constructor
typeDefinitions
-
Fields inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
undefinedConstructor
-
Fields inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
composer, rootTag, yamlClassConstructors, yamlConstructors, yamlMultiConstructors
-
-
Constructor Summary
Constructors Constructor Description CompactConstructor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplySequence(java.lang.Object bean, java.util.List<?> value)protected java.lang.ObjectconstructCompactFormat(ScalarNode node, CompactData data)protected ConstructcreateCompactConstruct()protected java.lang.ObjectcreateInstance(ScalarNode node, CompactData data)CompactDatagetCompactData(java.lang.String scalar)protected ConstructgetConstructor(Node node)Get the constructor to construct the Node.protected java.lang.StringgetSequencePropertyName(java.lang.Class<?> bean)Provide the name of the property which is used when the entries form a sequence.protected voidsetProperties(java.lang.Object bean, java.util.Map<java.lang.String,java.lang.Object> data)-
Methods inherited from class org.yaml.snakeyaml.constructor.Constructor
addTypeDescription, getClassForName, getClassForNode
-
Methods inherited from class org.yaml.snakeyaml.constructor.SafeConstructor
constructMapping2ndStep, constructSet2ndStep, flattenMapping
-
Methods inherited from class org.yaml.snakeyaml.constructor.BaseConstructor
checkData, constructArray, constructArrayStep2, constructDocument, constructMapping, constructObject, constructScalar, constructSequence, constructSequenceStep2, constructSet, constructSet, createArray, createDefaultList, createDefaultMap, createDefaultSet, createDefaultSet, getData, getPropertyUtils, getSingleData, isExplicitPropertyUtils, setComposer, setPropertyUtils
-
-
-
-
Method Detail
-
constructCompactFormat
protected java.lang.Object constructCompactFormat(ScalarNode node, CompactData data)
-
createInstance
protected java.lang.Object createInstance(ScalarNode node, CompactData data) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setProperties
protected void setProperties(java.lang.Object bean, java.util.Map<java.lang.String,java.lang.Object> data) throws java.lang.Exception- Throws:
java.lang.Exception
-
getCompactData
public CompactData getCompactData(java.lang.String scalar)
-
createCompactConstruct
protected Construct createCompactConstruct()
-
getConstructor
protected Construct getConstructor(Node node)
Description copied from class:BaseConstructorGet the constructor to construct the Node. For implicit tags if the runtime class is known a dedicated Construct implementation is used. Otherwise the constructor is chosen by the tag.- Overrides:
getConstructorin classBaseConstructor- Parameters:
node- Node to be constructed- Returns:
- Construct implementation for the specified node
-
applySequence
protected void applySequence(java.lang.Object bean, java.util.List<?> value)
-
getSequencePropertyName
protected java.lang.String getSequencePropertyName(java.lang.Class<?> bean) throws java.beans.IntrospectionExceptionProvide the name of the property which is used when the entries form a sequence. The property must be a List.- Throws:
java.beans.IntrospectionException
-
-