Module xml.jackson.extensions
Package io.github.astrapi69.xml.jackson
Class XmlFileToObjectExtensions
java.lang.Object
io.github.astrapi69.xml.jackson.XmlFileToObjectExtensions
The class
XmlFileToObjectExtensions provides methods for convert xml string objects to
java objects-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TtoObject(@NonNull File file, @NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Creates from the given xml string an java object.static <T> TtoObject(@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> TCreates from the given xml string an java object.static <T> TtoObject(@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> TCreates from the given xml string an java object.
-
Method Details
-
toObject
Creates from the given xml string an java object.- Type Parameters:
T- the generic type of the return type- Parameters:
file- the file objectclazz- 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 objecttypeReference- 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 objectjavaType- 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 objecttypeReference- the type referencexmlMapper- 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 objectjavaType- the java typexmlMapper- the xml mapper- Returns:
- the object
-