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 String |
dumpModelAsXml(org.apache.camel.CamelContext context,
org.apache.camel.NamedNode definition,
boolean resolvePlaceholders,
boolean resolveDelegateEndpoints)
Dumps the definition as XML
|
static RestsDefinition |
loadRestsDefinition(org.apache.camel.CamelContext context,
InputStream is) |
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
NamedNodeJAXBException - is throw if error marshalling to XMLpublic static String dumpModelAsXml(org.apache.camel.CamelContext context, org.apache.camel.NamedNode definition, boolean resolvePlaceholders, boolean resolveDelegateEndpoints) throws Exception
context - the CamelContext, if null then
ModelJAXBContextFactory is not in
usedefinition - the definition, such as a
NamedNoderesolvePlaceholders - whether to resolve property placeholders in
the dumped XMLresolveDelegateEndpoints - whether to resolve delegate endpoints in
the dumped XML (limited to endpoints used in uri attributes in
the model)Exception - 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 modelpublic static RestsDefinition loadRestsDefinition(org.apache.camel.CamelContext context, InputStream is) throws Exception
ExceptionApache Camel