org.apache.camel.model
Class ModelHelper

java.lang.Object
  extended by org.apache.camel.model.ModelHelper

public final class ModelHelper
extends Object

Helper for the Camel model classes.


Method Summary
static
<T extends NamedNode>
T
createModelFromXml(String xml, Class<T> type)
          Marshal the xml to the model definition
static String dumpModelAsXml(NamedNode definition)
          Dumps the definition as XML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

dumpModelAsXml

public static String dumpModelAsXml(NamedNode definition)
                             throws JAXBException
Dumps the definition as XML

Parameters:
definition - the definition, such as a NamedNode
Returns:
the output in XML (is formatted)
Throws:
JAXBException - is throw if error marshalling to XML

createModelFromXml

public static <T extends NamedNode> T createModelFromXml(String xml,
                                                         Class<T> type)
                                              throws JAXBException
Marshal the xml to the model definition

Parameters:
xml - the xml
type - the definition type to return, will throw a ClassCastException if not the expected type
Returns:
the model definition
Throws:
JAXBException - is thrown if error unmarshalling from xml to model


Apache CAMEL