Class XmlFileToObjectExtensions

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

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

    Modifier and Type
    Method
    Description
    static <T> T
    toObject(@NonNull File file, @NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
    Creates from the given xml string an java object.
    static <T> T
    toObject(@NonNull File file, @NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference, @NonNull com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper)
    Creates from the given xml string an java object.
    static <T> T
    toObject(@NonNull File file, @NonNull com.fasterxml.jackson.databind.JavaType javaType)
    Creates from the given xml string an java object.
    static <T> T
    toObject(@NonNull File file, @NonNull com.fasterxml.jackson.databind.JavaType javaType, @NonNull com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper)
    Creates from the given xml string an java object.
    static <T> T
    toObject(@NonNull File file, @NonNull 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(@NonNull @NonNull File file, @NonNull @NonNull Class<T> clazz)
      Creates from the given xml string an java object.
      Type Parameters:
      T - the generic type of the return type
      Parameters:
      file - the file object
      clazz - the class of the generic type
      Returns:
      the object
    • toObject

      public static <T> T toObject(@NonNull @NonNull File file, @NonNull @NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
      Creates from the given xml string an java object.
      Type Parameters:
      T - the generic type of the return type
      Parameters:
      file - the file object
      typeReference - the type reference
      Returns:
      the object
    • toObject

      public static <T> T toObject(@NonNull @NonNull File file, @NonNull @NonNull com.fasterxml.jackson.databind.JavaType javaType)
      Creates from the given xml string an java object.
      Type Parameters:
      T - the generic type of the return type
      Parameters:
      file - the file object
      javaType - the java type
      Returns:
      the object
    • toObject

      public static <T> T toObject(@NonNull @NonNull File file, @NonNull @NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference, @NonNull @NonNull com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper)
      Creates from the given xml string an java object.
      Type Parameters:
      T - the generic type of the return type
      Parameters:
      file - the file object
      typeReference - the type reference
      xmlMapper - the xml mapper
      Returns:
      the object
    • toObject

      public static <T> T toObject(@NonNull @NonNull File file, @NonNull @NonNull com.fasterxml.jackson.databind.JavaType javaType, @NonNull @NonNull com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper)
      Creates from the given xml string an java object.
      Type Parameters:
      T - the generic type of the return type
      Parameters:
      file - the file object
      javaType - the java type
      xmlMapper - the xml mapper
      Returns:
      the object