java.lang.Object
io.github.astrapi69.xml.jackson.XmlToObjectExtensions
The class
XmlToObjectExtensions
provides methods for convert xml string objects to java
objects-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Creates from the given xml string an java object.static <T> T
toObject
(String xmlString, com.fasterxml.jackson.core.type.TypeReference<T> typeReference, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper) Creates from the given xml string an java object.static <T> T
Creates from the given xml string an java object.static <T> T
toObject
(String xmlString, com.fasterxml.jackson.databind.JavaType javaType, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper) Creates from the given xml string an java object.static <T> T
Creates from the given xml string an java object.
-
Method Details
-
toObject
public static <T> T toObject(String xmlString, Class<T> clazz) throws com.fasterxml.jackson.core.JsonProcessingException Creates from the given xml string an java object.- Type Parameters:
T
- the generic type of the return type- Parameters:
xmlString
- the xmlclazz
- the class of the generic type- Returns:
- the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- is thrown when processing json content that are not pure I/O problems
-
toObject
public static <T> T toObject(String xmlString, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) throws com.fasterxml.jackson.core.JsonProcessingException Creates from the given xml string an java object.- Type Parameters:
T
- the generic type of the return type- Parameters:
xmlString
- the xmltypeReference
- the type reference- Returns:
- the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- is thrown when processing json content that are not pure I/O problems
-
toObject
public static <T> T toObject(String xmlString, com.fasterxml.jackson.databind.JavaType javaType) throws com.fasterxml.jackson.core.JsonProcessingException Creates from the given xml string an java object.- Type Parameters:
T
- the generic type of the return type- Parameters:
xmlString
- the xmljavaType
- the java type- Returns:
- the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- is thrown when processing json content that are not pure I/O problems
-
toObject
public static <T> T toObject(String xmlString, com.fasterxml.jackson.core.type.TypeReference<T> typeReference, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper) throws com.fasterxml.jackson.core.JsonProcessingException Creates from the given xml string an java object.- Type Parameters:
T
- the generic type of the return type- Parameters:
xmlString
- the xmltypeReference
- the type referencexmlMapper
- the xml mapper- Returns:
- the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- is thrown when processing json content that are not pure I/O problems
-
toObject
public static <T> T toObject(String xmlString, com.fasterxml.jackson.databind.JavaType javaType, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper) throws com.fasterxml.jackson.core.JsonProcessingException Creates from the given xml string an java object.- Type Parameters:
T
- the generic type of the return type- Parameters:
xmlString
- the xmljavaType
- the java typexmlMapper
- the xml mapper- Returns:
- the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- is thrown when processing json content that are not pure I/O problems
-