Class XmlToObjectExtensions

java.lang.Object
io.github.astrapi69.xml.jackson.XmlToObjectExtensions

public final class XmlToObjectExtensions extends Object
The class XmlToObjectExtensions provides methods for convert xml string objects to java objects
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    toObject(String xmlString, com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
    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
    toObject(String xmlString, com.fasterxml.jackson.databind.JavaType javaType)
    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
    toObject(String xmlString, Class<T> clazz)
    Creates from the given xml string an java object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 xml
      clazz - 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 xml
      typeReference - 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 xml
      javaType - 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 xml
      typeReference - the type reference
      xmlMapper - 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 xml
      javaType - the java type
      xmlMapper - 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