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 DataFormatDefinition
Marshal and unmarshal Java objects to and from YAML.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
YAMLDataFormat.Builder
Builder
is a specific builder forYAMLDataFormat
.
-
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 String
getAllowAnyType()
String
getAllowRecursiveKeys()
ClassLoader
getClassLoader()
String
getConstructor()
String
getDataFormatName()
String
getDumperOptions()
YAMLLibrary
getLibrary()
String
getMaxAliasesForCollections()
String
getPrettyFlow()
String
getRepresenter()
String
getResolver()
List<YAMLTypeFilterDefinition>
getTypeFilters()
Class<?>
getUnmarshalType()
String
getUnmarshalTypeName()
String
getUseApplicationContextClassLoader()
void
setAllowAnyType(String allowAnyType)
Allow any class to be un-marshaledvoid
setAllowRecursiveKeys(String allowRecursiveKeys)
Set whether recursive keys are allowed.void
setClassLoader(ClassLoader classLoader)
Set a custom classloadervoid
setConstructor(String constructor)
BaseConstructor to construct incoming documents.void
setDumperOptions(String dumperOptions)
DumperOptions to configure outgoing objects.void
setLibrary(YAMLLibrary library)
Which yaml library to use.void
setMaxAliasesForCollections(String maxAliasesForCollections)
Set the maximum amount of aliases allowed for collections.void
setPrettyFlow(String prettyFlow)
Force the emitter to produce a pretty YAML document when using the flow style.void
setRepresenter(String representer)
Representer to emit outgoing objects.void
setResolver(String resolver)
Resolver to detect implicit typevoid
setTypeFilters(List<YAMLTypeFilterDefinition> typeFilters)
Set the types SnakeYAML is allowed to un-marshallvoid
setUnmarshalType(Class<?> type)
Class of the object to be createdvoid
setUnmarshalTypeName(String unmarshalTypeName)
Class name of the java type to use when unmarshallingvoid
setUseApplicationContextClassLoader(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:
getDataFormatName
in 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.
-
-