Class YamlJavaBeanPropertyConstructor


  • public class YamlJavaBeanPropertyConstructor
    extends org.yaml.snakeyaml.constructor.Constructor
    Extended version of snakeyaml's Constructor class to facilitate mapping custom YAML keys to JavaBean property names.
    Author:
    Luke Taylor
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.yaml.snakeyaml.constructor.Constructor

        org.yaml.snakeyaml.constructor.Constructor.ConstructMapping, org.yaml.snakeyaml.constructor.Constructor.ConstructScalar, org.yaml.snakeyaml.constructor.Constructor.ConstructSequence, org.yaml.snakeyaml.constructor.Constructor.ConstructYamlObject
      • Nested classes/interfaces inherited from class org.yaml.snakeyaml.constructor.SafeConstructor

        org.yaml.snakeyaml.constructor.SafeConstructor.ConstructUndefined, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlBinary, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlBool, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlFloat, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlInt, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlMap, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlNull, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlOmap, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlPairs, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlSeq, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlSet, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlStr, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlTimestamp
    • Field Summary

      • Fields inherited from class org.yaml.snakeyaml.constructor.SafeConstructor

        undefinedConstructor
      • Fields inherited from class org.yaml.snakeyaml.constructor.BaseConstructor

        composer, rootTag, typeDefinitions, typeTags, yamlClassConstructors, yamlConstructors, yamlMultiConstructors
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addPropertyAlias​(String alias, Class<?> type, String name)
      Adds an alias for a JavaBean property name on a particular type.
      • Methods inherited from class org.yaml.snakeyaml.constructor.Constructor

        getClassForName, getClassForNode
      • Methods inherited from class org.yaml.snakeyaml.constructor.SafeConstructor

        constructMapping2ndStep, constructSet2ndStep, flattenMapping, 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, getPropertyUtils, getSingleData, isAllowDuplicateKeys, isExplicitPropertyUtils, newInstance, newInstance, newInstance, newList, newMap, newSet, setAllowDuplicateKeys, setComposer, setPropertyUtils
    • Constructor Detail

      • YamlJavaBeanPropertyConstructor

        public YamlJavaBeanPropertyConstructor​(Class<?> theRoot)
      • YamlJavaBeanPropertyConstructor

        public YamlJavaBeanPropertyConstructor​(Class<?> theRoot,
                                               Map<Class<?>,​Map<String,​String>> propertyAliases)
    • Method Detail

      • addPropertyAlias

        protected final void addPropertyAlias​(String alias,
                                              Class<?> type,
                                              String name)
        Adds an alias for a JavaBean property name on a particular type. The values of YAML keys with the alias name will be mapped to the JavaBean property.
        Parameters:
        alias - the alias to map
        type - the type of property
        name - the property name