Class XmlFileToObjectConverter

java.lang.Object
io.github.astrapi69.xml.jackson.XmlFileToObjectConverter
All Implemented Interfaces:
io.github.astrapi69.xml.api.XmlFileToObject, JacksonXmlFileToObject

public class XmlFileToObjectConverter extends Object implements JacksonXmlFileToObject
The class XmlFileToObjectConverter can convert a given xml file to an object
  • Constructor Details

    • XmlFileToObjectConverter

      public XmlFileToObjectConverter()
  • Method Details

    • toObject

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

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

      public <T> T toObject(@NonNull @NonNull File file, @NonNull @NonNull Class<T> aClass)
      Specified by:
      toObject in interface io.github.astrapi69.xml.api.XmlFileToObject