Modifier and Type | Method and Description |
---|---|
static String |
marshal(JAXBContext jaxbContext,
Object object)
Marshals the supplied object into an XML string, using the supplied jaxbContext.
|
static String |
marshal(MarshalParameters marshalParameters)
Marshals an object to XML using the supplied marshalParameters.
|
static <T> T |
unmarshal(JAXBContext jaxbContext,
String xml,
Class<T> type)
Unmarshalls the supplied xml into an object of the supplied type, using the supplied jaxbContext.
|
static <T> T |
unmarshal(UnmarshalParameters unmarshalParameters)
Unmarshals XML into an object, where all necessary information is stored in the supplied unmarshalParameters.
|
public static String marshal(JAXBContext jaxbContext, Object object) throws JAXBException
jaxbContext
- The JAXBContext used for marshalling or null to create a fresh JAXBContext.object
- The object to marshal.JAXBException
- When the supplied object could not be marshalled.NullPointerException
- When the supplied object is null.public static String marshal(MarshalParameters marshalParameters) throws JAXBException
marshal(JAXBContext, Object)
when you need more control over the marshalling
process.marshalParameters
- The parameter object for the marshalling process.JAXBException
- When the object could not be marshalled.NullPointerException
- When the supplied marshallParameters is null.public static <T> T unmarshal(JAXBContext jaxbContext, String xml, Class<T> type) throws JAXBException
T
- The type of the object.jaxbContext
- The JAXBContext used for unmarshalling or null to create a fresh JAXBContext.xml
- The xml to unmarshal.type
- The type of the object.JAXBException
- When the supplied xml could not be unmarshalled.NullPointerException
- When either the supplied xml or type is null.IllegalArgumentException
- When the supplied xml is empty.public static <T> T unmarshal(UnmarshalParameters unmarshalParameters) throws JAXBException
T
- The type to unmarshal to.unmarshalParameters
- The parameter object for the unmarshalling process.JAXBException
- When the XML could not be unmarshalled.NullPointerException
- When the supplied unmarshalParameters is null.Copyright © 2008–2018. All rights reserved.