public final class ModelHelper extends Object
model
classes.Modifier and Type | Method and Description |
---|---|
static <T extends org.apache.camel.NamedNode> |
createModelFromXml(org.apache.camel.CamelContext context,
InputStream stream,
Class<T> type)
Marshal the xml to the model definition
|
static <T extends org.apache.camel.NamedNode> |
createModelFromXml(org.apache.camel.CamelContext context,
String xml,
Class<T> type)
Marshal the xml to the model definition
|
static String |
dumpModelAsXml(org.apache.camel.CamelContext context,
org.apache.camel.NamedNode definition)
Dumps the definition as XML
|
static RoutesDefinition |
loadRoutesDefinition(org.apache.camel.CamelContext context,
InputStream inputStream)
Marshal the xml to the model definition
|
static RoutesDefinition |
loadRoutesDefinition(org.apache.camel.CamelContext context,
Node node)
Marshal the xml to the model definition
|
public static String dumpModelAsXml(org.apache.camel.CamelContext context, org.apache.camel.NamedNode definition) throws JAXBException
context
- the CamelContext, if null then ModelJAXBContextFactory
is not in usedefinition
- the definition, such as a NamedNode
JAXBException
- is throw if error marshalling to XMLpublic static <T extends org.apache.camel.NamedNode> T createModelFromXml(org.apache.camel.CamelContext context, String xml, Class<T> type) throws JAXBException
context
- the CamelContext, if null then ModelJAXBContextFactory
is not in usexml
- 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 org.apache.camel.NamedNode> T createModelFromXml(org.apache.camel.CamelContext context, InputStream stream, Class<T> type) throws JAXBException
context
- the CamelContext, if null then ModelJAXBContextFactory
is not in usestream
- 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 RoutesDefinition loadRoutesDefinition(org.apache.camel.CamelContext context, InputStream inputStream) throws Exception
context
- the CamelContext, if null then ModelJAXBContextFactory
is not in useinputStream
- the xml streamException
- is thrown if an error is encountered unmarshalling from xml to modelpublic static RoutesDefinition loadRoutesDefinition(org.apache.camel.CamelContext context, Node node) throws Exception
context
- the CamelContext, if null then ModelJAXBContextFactory
is not in usenode
- the xml nodeException
- is thrown if an error is encountered unmarshalling from xml to modelApache Camel