Class YamlDeserializerBase<T>

java.lang.Object
org.apache.camel.dsl.yaml.common.YamlDeserializerSupport
org.apache.camel.dsl.yaml.common.YamlDeserializerBase<T>
All Implemented Interfaces:
org.snakeyaml.engine.v2.api.ConstructNode
Direct Known Subclasses:
YamlDeserializerEndpointAwareBase

public abstract class YamlDeserializerBase<T> extends YamlDeserializerSupport implements org.snakeyaml.engine.v2.api.ConstructNode
  • Constructor Details

    • YamlDeserializerBase

      public YamlDeserializerBase(Class<T> type)
  • Method Details

    • getType

      public Class<T> getType()
    • construct

      public Object construct(org.snakeyaml.engine.v2.nodes.Node node)
      Specified by:
      construct in interface org.snakeyaml.engine.v2.api.ConstructNode
    • newInstance

      protected abstract T newInstance()
      Creates a Java instance of the expected type.
      Returns:
      the instance.
    • afterPropertiesSet

      protected void afterPropertiesSet(T target, org.snakeyaml.engine.v2.nodes.Node node)
      Allows custom validation after the properties has been set on the target
    • newInstance

      protected T newInstance(String value)
      Creates a Java instance of the expected type from a string.
      Returns:
      the instance.
    • setProperty

      protected boolean setProperty(T target, String propertyKey, String propertyName, org.snakeyaml.engine.v2.nodes.Node value)
      Set a property to the given target.
      Parameters:
      target - the target object
      propertyKey - the normalized property key
      propertyName - the name of the property as defined in the YAML
      value - the value of the property as Node
    • setProperties

      protected void setProperties(T target, org.snakeyaml.engine.v2.nodes.MappingNode node)
      Set properties from a YAML node to the given target.
      Parameters:
      target - the target object
      node - the node
    • handleUnknownProperty

      protected void handleUnknownProperty(T target, String propertyKey, String propertyName, org.snakeyaml.engine.v2.nodes.Node value)
    • onNewTarget

      protected void onNewTarget(org.snakeyaml.engine.v2.nodes.Node node, T target, int line)