Package org.camunda.spin
Class Spin<T extends Spin<?>>
java.lang.Object
org.camunda.spin.Spin<T>
- Direct Known Subclasses:
SpinJsonNode
,SpinXmlNode
- Author:
- Sebastian Menski, Daniel Meyer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
Provides the name of the dataformat used by this spin.static SpinJsonNode
Creates a spin wrapper for a data input.abstract <C> C
Maps the wrapped object to an instance of a java class.abstract <C> C
Maps the wrapped object to a java object.static <T extends Spin<?>>
TCreates a spin wrapper for a data input.static <T extends Spin<?>>
TCreates a spin wrapper for a data input of a given data format.static <T extends Spin<?>>
TS
(Object input, DataFormat<T> format) Creates a spin wrapper for a data input of a given data format.abstract String
toString()
Returns the wrapped object as string representation.abstract Object
unwrap()
Return the wrapped object.abstract void
writeToWriter
(Writer writer) Writes the wrapped object to a existing writer.static SpinXmlElement
Creates a spin wrapper for a data input.
-
Constructor Details
-
Spin
public Spin()
-
-
Method Details
-
S
Creates a spin wrapper for a data input of a given data format.- Parameters:
input
- the input to wrapformat
- the data format of the input- Returns:
- the spin wrapper for the input
- Throws:
IllegalArgumentException
- in case an argument of illegal type is provided (such as 'null')
-
S
Creates a spin wrapper for a data input of a given data format.- Parameters:
input
- the input to wrapdataFormatName
- the data format name of the input- Returns:
- the spin wrapper for the input
- Throws:
IllegalArgumentException
- in case an argument of illegal type is provided (such as 'null')
-
S
Creates a spin wrapper for a data input. The data format of the input is auto detected.- Parameters:
input
- the input to wrap- Returns:
- the spin wrapper for the input
- Throws:
IllegalArgumentException
- in case an argument of illegal type is provided (such as 'null')
-
XML
Creates a spin wrapper for a data input. The data format of the input is assumed to be XML.- Parameters:
input
- the input to wrap- Returns:
- the spin wrapper for the input
- Throws:
IllegalArgumentException
- in case an argument of illegal type is provided (such as 'null')
-
JSON
Creates a spin wrapper for a data input. The data format of the input is assumed to be JSON.- Parameters:
input
- the input to wrap- Returns:
- the spin wrapper for the input
- Throws:
IllegalArgumentException
- in case an argument of illegal type is provided (such as 'null')
-
getDataFormatName
Provides the name of the dataformat used by this spin.- Returns:
- the name of the dataformat used by this Spin.
-
unwrap
Return the wrapped object. The return type of this method depends on the concrete data format.- Returns:
- the object wrapped by this wrapper.
-
toString
Returns the wrapped object as string representation. -
writeToWriter
Writes the wrapped object to a existing writer.- Parameters:
writer
- the writer to write to
-
mapTo
Maps the wrapped object to an instance of a java class.- Parameters:
type
- the java class to map to- Returns:
- the mapped object
-
mapTo
Maps the wrapped object to a java object. The object is determined based on the configuration string which is data format specific.- Parameters:
type
- the class name to map to- Returns:
- the mapped object
-