|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.xml.JAXBXMLHelper
public class JAXBXMLHelper
Helper class for JAXB annotated classes.
XMLHelper,
XMLIteratorFactory,
JAXBMap,
JAXBList,
JAXBSet,
JAXBCollection| Nested Class Summary | |
|---|---|
static class |
JAXBXMLHelper.JAXBContextBasedUnmarshaller<E>
Holder of a fully instantiated Unmarshaller instance |
protected static class |
JAXBXMLHelper.MarshallingAndUnmarshallingConfigurationAbstractBase
Configuration for the marshalling process |
static class |
JAXBXMLHelper.MarshallingConfiguration
|
static class |
JAXBXMLHelper.UnmarshallingConfiguration
|
| Field Summary | |
|---|---|
static String |
DEFAULT_ENCODING
|
| Constructor Summary | |
|---|---|
JAXBXMLHelper()
|
|
| Method Summary | ||
|---|---|---|
static
|
cloneObject(E object)
Clones a given Object using storeObjectAsXML(Object) and loadObjectFromXML(CharSequence, Class) |
|
static
|
cloneObject(E object,
JAXBXMLHelper.MarshallingConfiguration marshallingConfiguration)
Similar to cloneObject(Object) allowing to specify a JAXBXMLHelper.MarshallingConfiguration |
|
static QName |
determineRootName(Class<?> type)
Returns the QName defined by the XmlRootElement of the given Class type |
|
static
|
loadObjectFromNode(Node node,
Class<E> type)
Similar to loadObjectFromNode(Node, Class, ExceptionHandler) but ignoring Exceptions |
|
static
|
loadObjectFromNode(Node node,
Class<E> type,
ExceptionHandler exceptionHandler)
Loads an object of the given class type from an Node. |
|
static
|
loadObjectFromXML(CharSequence charSequence,
Class<E> type)
Loads an Object from a CharSequence which contains valid xml text content. |
|
static
|
loadObjectFromXML(CharSequence charSequence,
Class<E> type,
ExceptionHandler exceptionHandler)
Loads an Object from a CharSequence which contains valid xml text content. |
|
static
|
loadObjectFromXML(CharSequence charSequence,
Class<E> type,
JAXBXMLHelper.UnmarshallingConfiguration unmarshallingConfiguration)
Similar to loadObjectFromXML(CharSequence, Class) allowing to specify an JAXBXMLHelper.UnmarshallingConfiguration |
|
static
|
loadObjectFromXML(InputStream inputStream,
Class<E> typeClazz)
Loads an object from the given class type from an InputStream. |
|
static
|
loadObjectFromXML(InputStream inputStream,
Class<E> type,
ExceptionHandler exceptionHandler)
Loads an object of the given class type from an InputStream. |
|
static
|
loadObjectFromXML(InputStream inputStream,
Class<E> type,
JAXBXMLHelper.UnmarshallingConfiguration unmarshallingConfiguration)
Similar to loadObjectFromXML(InputStream, Class) allowing to declare a JAXBXMLHelper.UnmarshallingConfiguration |
|
static
|
loadObjectFromXML(String xmlContent,
Class<E> typeClazz)
|
|
static
|
loadObjectFromXML(String xmlContent,
Class<E> type,
ExceptionHandler exceptionHandler)
|
|
static
|
newJAXBContextBasedUnmarshaller(Class<E> type,
JAXBXMLHelper.UnmarshallingConfiguration unmarshallingConfiguration)
Returns a new JAXBXMLHelper.JAXBContextBasedUnmarshaller instance. |
|
static String |
storeObjectAsXML(Object object)
Stores the given object as XML String using the DEFAULT_ENCODING |
|
static void |
storeObjectAsXML(Object object,
Appendable appendable)
Stores the given objects as XML within the given Appendable using the DEFAULT_ENCODING |
|
static void |
storeObjectAsXML(Object object,
Appendable appendable,
String encoding)
Stores the given object as XML within the given Appendable using the given encoding. |
|
static String |
storeObjectAsXML(Object object,
ExceptionHandler exceptionHandler)
Stores the given object as XML String using the DEFAULT_ENCODING |
|
static String |
storeObjectAsXML(Object object,
JAXBXMLHelper.MarshallingConfiguration marshallingConfiguration)
Similar to storeObjectAsXML(Object) but allows to specify a JAXBXMLHelper.MarshallingConfiguration instance |
|
static void |
storeObjectAsXML(Object object,
OutputStream outputStream)
Stores a given JAXB annotated object to the given OutputStream using the DEFAULT_ENCODING |
|
static void |
storeObjectAsXML(Object object,
OutputStream outputStream,
ExceptionHandler exceptionHandler)
|
|
static void |
storeObjectAsXML(Object object,
OutputStream outputStream,
JAXBXMLHelper.MarshallingConfiguration marshallingConfiguration)
Stores a given JAXB annotated object to the given OutputStream using the given JAXBXMLHelper.MarshallingConfiguration |
|
static void |
storeObjectAsXML(Object object,
OutputStream outputStream,
String encoding)
Stores a given JAXB annotated object to the given OutputStream using the given character encoding |
|
static void |
storeObjectAsXML(Object object,
OutputStream outputStream,
String encoding,
ExceptionHandler exceptionHandler)
Stores a given JAXB annotated object to the given OutputStream using the given character encoding |
|
static String |
storeObjectAsXML(Object object,
String encoding)
Stores the given object as XML String using the given encoding. |
|
static String |
storeObjectAsXML(Object object,
String encoding,
ExceptionHandler exceptionHandler)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_ENCODING
| Constructor Detail |
|---|
public JAXBXMLHelper()
| Method Detail |
|---|
public static void storeObjectAsXML(Object object,
OutputStream outputStream)
OutputStream using the DEFAULT_ENCODING
object - outputStream - storeObjectAsXML(Object, OutputStream, String)
public static void storeObjectAsXML(Object object,
OutputStream outputStream,
ExceptionHandler exceptionHandler)
object - outputStream - exceptionHandler - storeObjectAsXML(Object)
public static void storeObjectAsXML(Object object,
OutputStream outputStream,
String encoding)
OutputStream using the given character encoding
object - outputStream - encoding - storeObjectAsXML(Object, OutputStream)
public static void storeObjectAsXML(Object object,
OutputStream outputStream,
String encoding,
ExceptionHandler exceptionHandler)
OutputStream using the given character encoding
object - outputStream - encoding - exceptionHandler - ExceptionHandlerstoreObjectAsXML(Object, OutputStream)
public static void storeObjectAsXML(Object object,
OutputStream outputStream,
JAXBXMLHelper.MarshallingConfiguration marshallingConfiguration)
OutputStream using the given JAXBXMLHelper.MarshallingConfiguration
object - outputStream - marshallingConfiguration - JAXBXMLHelper.MarshallingConfigurationstoreObjectAsXML(Object, OutputStream)
public static void storeObjectAsXML(Object object,
Appendable appendable)
Appendable using the DEFAULT_ENCODING
object - appendable -
public static void storeObjectAsXML(Object object,
Appendable appendable,
String encoding)
Appendable using the given encoding. E.g as Appendable a
StringBuilder or StringBuffer can be used.
object - appendable - encoding - public static String storeObjectAsXML(Object object)
String using the DEFAULT_ENCODING
object -
storeObjectAsXML(Object, String)
public static String storeObjectAsXML(Object object,
JAXBXMLHelper.MarshallingConfiguration marshallingConfiguration)
storeObjectAsXML(Object) but allows to specify a JAXBXMLHelper.MarshallingConfiguration instance
object - marshallingConfiguration - JAXBXMLHelper.MarshallingConfiguration
public static String storeObjectAsXML(Object object,
ExceptionHandler exceptionHandler)
String using the DEFAULT_ENCODING
object - exceptionHandler - ExceptionHandler
storeObjectAsXML(Object, String)
public static String storeObjectAsXML(Object object,
String encoding)
String using the given encoding.
object - encoding -
storeObjectAsXML(Object, OutputStream),
storeObjectAsXML(Object)
public static String storeObjectAsXML(Object object,
String encoding,
ExceptionHandler exceptionHandler)
object - encoding - exceptionHandler -
storeObjectAsXML(Object, String)
public static <E> E loadObjectFromXML(InputStream inputStream,
Class<E> typeClazz)
InputStream. The class has to have JAXB annotations.
E - inputStream - typeClazz -
public static <E> E loadObjectFromXML(InputStream inputStream,
Class<E> type,
ExceptionHandler exceptionHandler)
InputStream. The class has to have JAXB annotations.
E - inputStream - type - exceptionHandler -
public static <E> JAXBXMLHelper.JAXBContextBasedUnmarshaller<E> newJAXBContextBasedUnmarshaller(Class<E> type,
JAXBXMLHelper.UnmarshallingConfiguration unmarshallingConfiguration)
JAXBXMLHelper.JAXBContextBasedUnmarshaller instance. This can be used to marshal multiple InputStreams
without the costly overhead of constructing a new JAXBContext each time.
type - unmarshallingConfiguration -
JAXBXMLHelper.JAXBContextBasedUnmarshaller
public static <E> E loadObjectFromXML(InputStream inputStream,
Class<E> type,
JAXBXMLHelper.UnmarshallingConfiguration unmarshallingConfiguration)
loadObjectFromXML(InputStream, Class) allowing to declare a JAXBXMLHelper.UnmarshallingConfiguration
E - inputStream - InputStreamtype - ClassunmarshallingConfiguration - JAXBXMLHelper.UnmarshallingConfiguration
InputStreamnewJAXBContextBasedUnmarshaller(Class, UnmarshallingConfiguration)
public static <E> E loadObjectFromNode(Node node,
Class<E> type)
loadObjectFromNode(Node, Class, ExceptionHandler) but ignoring Exceptions
E - node - Nodetype -
public static <E> E loadObjectFromNode(Node node,
Class<E> type,
ExceptionHandler exceptionHandler)
Node. The class has to have JAXB annotations.
E - node - Nodetype - exceptionHandler -
public static <E> E loadObjectFromXML(CharSequence charSequence,
Class<E> type)
Object from a CharSequence which contains valid xml text content. The given Class type
specifies the root object type.
charSequence - type -
public static <E> E loadObjectFromXML(CharSequence charSequence,
Class<E> type,
ExceptionHandler exceptionHandler)
Object from a CharSequence which contains valid xml text content. The given Class type
specifies the root object type.
charSequence - type - exceptionHandler -
public static <E> E loadObjectFromXML(CharSequence charSequence,
Class<E> type,
JAXBXMLHelper.UnmarshallingConfiguration unmarshallingConfiguration)
loadObjectFromXML(CharSequence, Class) allowing to specify an JAXBXMLHelper.UnmarshallingConfiguration
charSequence - CharSequencetype - unmarshallingConfiguration - JAXBXMLHelper.UnmarshallingConfiguration
public static <E> E loadObjectFromXML(String xmlContent,
Class<E> typeClazz)
xmlContent - typeClazz -
public static <E> E loadObjectFromXML(String xmlContent,
Class<E> type,
ExceptionHandler exceptionHandler)
xmlContent - type - exceptionHandler -
public static <E> E cloneObject(E object)
Object using storeObjectAsXML(Object) and loadObjectFromXML(CharSequence, Class)
object -
public static <E> E cloneObject(E object,
JAXBXMLHelper.MarshallingConfiguration marshallingConfiguration)
cloneObject(Object) allowing to specify a JAXBXMLHelper.MarshallingConfiguration
object -
public static QName determineRootName(Class<?> type)
QName defined by the XmlRootElement of the given Class type
type -
QName
MissingXMLRootElementAnnotationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||