public abstract class JaxbUtils extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
JaxbUtils.LoggingValidationEventHandler |
Modifier and Type | Method and Description |
---|---|
static <T> T |
duplicateObject(T obj,
Class<T> clazz) |
static Class<?> |
getClassForElement(String elementName) |
static JAXBContext |
getContextFor(Class<?> clazz) |
static Marshaller |
getMarshallerFor(Object obj,
JAXBContext jaxbContext) |
static <T> String |
getNamespaceForClass(Class<T> clazz) |
static <T> List<String> |
getNamespacesForClass(Class<T> clazz) |
static Unmarshaller |
getUnmarshallerFor(Object obj,
JAXBContext jaxbContext,
boolean validate)
Get a JAXB unmarshaller for the given object.
|
static <T> XMLFilter |
getXMLFilterForClass(Class<T> clazz) |
static String |
marshal(Object obj) |
static void |
marshal(Object obj,
File file) |
static void |
marshal(Object obj,
Writer writer) |
static <T> T |
unmarshal(Class<T> clazz,
File file) |
static <T> T |
unmarshal(Class<T> clazz,
File file,
boolean validate) |
static <T> T |
unmarshal(Class<T> clazz,
InputSource inputSource) |
static <T> T |
unmarshal(Class<T> clazz,
InputSource inputSource,
boolean validate) |
static <T> T |
unmarshal(Class<T> clazz,
InputSource inputSource,
JAXBContext jaxbContext) |
static <T> T |
unmarshal(Class<T> clazz,
InputSource inputSource,
JAXBContext jaxbContext,
boolean validate) |
static <T> T |
unmarshal(Class<T> clazz,
InputStream stream) |
static <T> T |
unmarshal(Class<T> clazz,
InputStream stream,
boolean validate) |
static <T> T |
unmarshal(Class<T> clazz,
Reader reader) |
static <T> T |
unmarshal(Class<T> clazz,
Reader reader,
boolean validate) |
static <T> T |
unmarshal(Class<T> clazz,
org.springframework.core.io.Resource resource) |
static <T> T |
unmarshal(Class<T> clazz,
org.springframework.core.io.Resource resource,
boolean validate) |
static <T> T |
unmarshal(Class<T> clazz,
String xml) |
static <T> T |
unmarshal(Class<T> clazz,
String xml,
boolean validate) |
public static void marshal(Object obj, File file) throws IOException
IOException
public static <T> T unmarshal(Class<T> clazz, InputStream stream)
public static <T> T unmarshal(Class<T> clazz, InputStream stream, boolean validate)
public static <T> T unmarshal(Class<T> clazz, org.springframework.core.io.Resource resource)
public static <T> T unmarshal(Class<T> clazz, org.springframework.core.io.Resource resource, boolean validate)
public static <T> T unmarshal(Class<T> clazz, InputSource inputSource)
public static <T> T unmarshal(Class<T> clazz, InputSource inputSource, boolean validate)
public static <T> T unmarshal(Class<T> clazz, InputSource inputSource, JAXBContext jaxbContext)
public static <T> T unmarshal(Class<T> clazz, InputSource inputSource, JAXBContext jaxbContext, boolean validate)
public static <T> XMLFilter getXMLFilterForClass(Class<T> clazz) throws SAXException
SAXException
public static Marshaller getMarshallerFor(Object obj, JAXBContext jaxbContext)
public static Unmarshaller getUnmarshallerFor(Object obj, JAXBContext jaxbContext, boolean validate)
obj
- The object type to be unmarshalled.jaxbContext
- An optional JAXB context to create the unmarshaller from.validate
- TODOpublic static JAXBContext getContextFor(Class<?> clazz) throws JAXBException
JAXBException
public static <T> T duplicateObject(T obj, Class<T> clazz)
Copyright © 2021. All rights reserved.