public final class ModelHelper extends Object
model classes.| Modifier and Type | Method and Description |
|---|---|
static JAXBContext |
createJaxbContext() |
static <T extends NamedNode> |
createModelFromXml(InputStream stream,
Class<T> type)
Marshal the xml to the model definition
|
static <T extends NamedNode> |
createModelFromXml(String xml,
Class<T> type)
Marshal the xml to the model definition
|
static String |
dumpModelAsXml(NamedNode definition)
Dumps the definition as XML
|
public static String dumpModelAsXml(NamedNode definition) throws JAXBException
definition - the definition, such as a NamedNodeJAXBException - is throw if error marshalling to XMLpublic static <T extends NamedNode> T createModelFromXml(String xml, Class<T> type) throws JAXBException
xml - the xmltype - the definition type to return, will throw a ClassCastException if not the expected typeJAXBException - is thrown if error unmarshalling from xml to modelpublic static <T extends NamedNode> T createModelFromXml(InputStream stream, Class<T> type) throws JAXBException
stream - the xml streamtype - the definition type to return, will throw a ClassCastException if not the expected typeJAXBException - is thrown if error unmarshalling from xml to modelpublic static JAXBContext createJaxbContext() throws JAXBException
JAXBExceptionApache Camel