org.yaml.snakeyaml.extensions.compactnotation
Class CompactConstructor

java.lang.Object
  extended by org.yaml.snakeyaml.constructor.BaseConstructor
      extended by org.yaml.snakeyaml.constructor.SafeConstructor
          extended by org.yaml.snakeyaml.constructor.Constructor
              extended by 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
 class CompactConstructor.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.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
rootTag, yamlClassConstructors, yamlConstructors, yamlMultiConstructors
 
Constructor Summary
CompactConstructor()
           
 
Method Summary
protected  void applySequence(Object bean, List<?> value)
           
protected  Object constructCompactFormat(ScalarNode node, CompactData data)
           
protected  Object constructScalar(ScalarNode node)
           
protected  Object createInstance(ScalarNode node, CompactData data)
           
 CompactData getCompactData(String scalar)
           
protected  Construct getConstructor(Node node)
          Get the constructor to construct the Node.
protected  String getSequencePropertyName(Class<?> bean)
          Provide the name of the property which is used when the entries form a sequence.
protected  void setProperties(Object bean, Map<String,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, constructMapping, constructObject, constructSequence, constructSequenceStep2, constructSet, constructSet, createArray, createDefaultList, createDefaultMap, createDefaultSet, createDefaultSet, getData, getPropertyUtils, getSingleData, isExplicitPropertyUtils, setComposer, setPropertyUtils
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompactConstructor

public CompactConstructor()
Method Detail

constructScalar

protected Object constructScalar(ScalarNode node)
Overrides:
constructScalar in class BaseConstructor

constructCompactFormat

protected Object constructCompactFormat(ScalarNode node,
                                        CompactData data)

createInstance

protected Object createInstance(ScalarNode node,
                                CompactData data)
                         throws Exception
Throws:
Exception

setProperties

protected void setProperties(Object bean,
                             Map<String,Object> data)
                      throws Exception
Throws:
Exception

getCompactData

public CompactData getCompactData(String scalar)

getConstructor

protected Construct getConstructor(Node node)
Description copied from class: BaseConstructor
Get 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:
getConstructor in class BaseConstructor
Parameters:
node - Node to be constructed
Returns:
Construct implementation for the specified node

applySequence

protected void applySequence(Object bean,
                             List<?> value)

getSequencePropertyName

protected String getSequencePropertyName(Class<?> bean)
                                  throws IntrospectionException
Provide the name of the property which is used when the entries form a sequence. The property must be a List.

Throws:
IntrospectionException


Copyright © 2008-2011. All Rights Reserved.