Package org.apache.camel.dsl.yaml.common
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 Summary
Constructors Constructor Description YamlDeserializerBase(Class<T> type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
construct(org.snakeyaml.engine.v2.nodes.Node node)
Class<T>
getType()
protected void
handleUnknownProperty(T target, String propertyKey, String propertyName, org.snakeyaml.engine.v2.nodes.Node value)
protected abstract T
newInstance()
Creates a Java instance of the expected type.protected T
newInstance(String value)
Creates a Java instance of the expected type from a string.protected void
setProperties(T target, org.snakeyaml.engine.v2.nodes.MappingNode node)
Set properties from a YAML node to the given target.protected boolean
setProperty(T target, String propertyKey, String propertyName, org.snakeyaml.engine.v2.nodes.Node value)
Set a property to the given target.-
Methods inherited from class org.apache.camel.dsl.yaml.common.YamlDeserializerSupport
asBoolean, asByteArray, asByteArray, asClass, asClass, asClassArray, asClassArray, asDouble, asEndpoint, asEndpoint, asFlatCollection, asFlatList, asFlatSet, asInt, asLong, asMap, asMappingNode, asNestedCollection, asNestedList, asNestedSet, asScalarMap, asSequenceNode, asStringList, asStringList, asStringSet, asStringSet, asText, asType, getDeserializationContext, getNamedNode, nodeAt, setDeserializationContext, setSteps
-
-
-
-
Method Detail
-
construct
public Object construct(org.snakeyaml.engine.v2.nodes.Node node)
- Specified by:
construct
in interfaceorg.snakeyaml.engine.v2.api.ConstructNode
-
newInstance
protected abstract T newInstance()
Creates a Java instance of the expected type.- Returns:
- the instance.
-
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 objectpropertyKey
- the normalized property keypropertyName
- the name of the property as defined in the YAMLvalue
- the value of the property asNode
-
setProperties
protected void setProperties(T target, org.snakeyaml.engine.v2.nodes.MappingNode node)
Set properties from a YAML node to the given target.- Parameters:
node
- the nodetarget
- the target object
-
-