Class YAMLDataFormat
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.DataFormatDefinition
-
- org.apache.camel.model.dataformat.YAMLDataFormat
-
@Metadata(firstVersion="2.17.0", label="dataformat,transformation,yaml", title="YAML") public class YAMLDataFormat extends DataFormatDefinitionMarshal and unmarshal Java objects to and from YAML.
-
-
Constructor Summary
Constructors Constructor Description YAMLDataFormat()YAMLDataFormat(YAMLLibrary library)YAMLDataFormat(YAMLLibrary library, Class<?> unmarshalType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAllowAnyType()StringgetAllowRecursiveKeys()ClassLoadergetClassLoader()StringgetConstructor()StringgetDataFormatName()StringgetDumperOptions()YAMLLibrarygetLibrary()StringgetMaxAliasesForCollections()StringgetPrettyFlow()StringgetRepresenter()StringgetResolver()List<YAMLTypeFilterDefinition>getTypeFilters()Class<?>getUnmarshalType()StringgetUnmarshalTypeName()StringgetUseApplicationContextClassLoader()voidsetAllowAnyType(String allowAnyType)Allow any class to be un-marshaledvoidsetAllowRecursiveKeys(String allowRecursiveKeys)Set whether recursive keys are allowed.voidsetClassLoader(ClassLoader classLoader)Set a custom classloadervoidsetConstructor(String constructor)BaseConstructor to construct incoming documents.voidsetDumperOptions(String dumperOptions)DumperOptions to configure outgoing objects.voidsetLibrary(YAMLLibrary library)Which yaml library to use.voidsetMaxAliasesForCollections(String maxAliasesForCollections)Set the maximum amount of aliases allowed for collections.voidsetPrettyFlow(String prettyFlow)Force the emitter to produce a pretty YAML document when using the flow style.voidsetRepresenter(String representer)Representer to emit outgoing objects.voidsetResolver(String resolver)Resolver to detect implicit typevoidsetTypeFilters(List<YAMLTypeFilterDefinition> typeFilters)Set the types SnakeYAML is allowed to un-marshallvoidsetUnmarshalType(Class<?> type)Class of the object to be createdvoidsetUnmarshalTypeName(String unmarshalTypeName)Class name of the java type to use when unmarshallingvoidsetUseApplicationContextClassLoader(String useApplicationContextClassLoader)Use ApplicationContextClassLoader as custom ClassLoader-
Methods inherited from class org.apache.camel.model.DataFormatDefinition
getDataFormat, getShortName, setDataFormat, setDataFormatName
-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Constructor Detail
-
YAMLDataFormat
public YAMLDataFormat()
-
YAMLDataFormat
public YAMLDataFormat(YAMLLibrary library)
-
YAMLDataFormat
public YAMLDataFormat(YAMLLibrary library, Class<?> unmarshalType)
-
-
Method Detail
-
getDataFormatName
public String getDataFormatName()
- Overrides:
getDataFormatNamein classDataFormatDefinition
-
getLibrary
public YAMLLibrary getLibrary()
-
setLibrary
public void setLibrary(YAMLLibrary library)
Which yaml library to use. By default it is SnakeYAML
-
getUnmarshalType
public Class<?> getUnmarshalType()
-
setUnmarshalType
public void setUnmarshalType(Class<?> type)
Class of the object to be created
-
getUnmarshalTypeName
public String getUnmarshalTypeName()
-
setUnmarshalTypeName
public void setUnmarshalTypeName(String unmarshalTypeName)
Class name of the java type to use when unmarshalling
-
getClassLoader
public ClassLoader getClassLoader()
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
Set a custom classloader
-
getConstructor
public String getConstructor()
-
setConstructor
public void setConstructor(String constructor)
BaseConstructor to construct incoming documents.
-
getRepresenter
public String getRepresenter()
-
setRepresenter
public void setRepresenter(String representer)
Representer to emit outgoing objects.
-
getDumperOptions
public String getDumperOptions()
-
setDumperOptions
public void setDumperOptions(String dumperOptions)
DumperOptions to configure outgoing objects.
-
getResolver
public String getResolver()
-
setResolver
public void setResolver(String resolver)
Resolver to detect implicit type
-
getUseApplicationContextClassLoader
public String getUseApplicationContextClassLoader()
-
setUseApplicationContextClassLoader
public void setUseApplicationContextClassLoader(String useApplicationContextClassLoader)
Use ApplicationContextClassLoader as custom ClassLoader
-
getPrettyFlow
public String getPrettyFlow()
-
setPrettyFlow
public void setPrettyFlow(String prettyFlow)
Force the emitter to produce a pretty YAML document when using the flow style.
-
getAllowAnyType
public String getAllowAnyType()
-
setAllowAnyType
public void setAllowAnyType(String allowAnyType)
Allow any class to be un-marshaled
-
getTypeFilters
public List<YAMLTypeFilterDefinition> getTypeFilters()
-
setTypeFilters
public void setTypeFilters(List<YAMLTypeFilterDefinition> typeFilters)
Set the types SnakeYAML is allowed to un-marshall
-
getMaxAliasesForCollections
public String getMaxAliasesForCollections()
-
setMaxAliasesForCollections
public void setMaxAliasesForCollections(String maxAliasesForCollections)
Set the maximum amount of aliases allowed for collections.
-
getAllowRecursiveKeys
public String getAllowRecursiveKeys()
-
setAllowRecursiveKeys
public void setAllowRecursiveKeys(String allowRecursiveKeys)
Set whether recursive keys are allowed.
-
-