org.ow2.jonas.camel.registry.xml.loader
Class XmlLoader

java.lang.Object
  extended by org.ow2.jonas.camel.registry.xml.loader.XmlLoader

public class XmlLoader
extends java.lang.Object

Loads an XML file using JAXB.


Constructor Summary
XmlLoader()
           
 
Method Summary
static
<T> T
loadSchemaAndFile(java.lang.String xsdPath, java.lang.Class<T> rootClass, java.io.InputStream xmlInputStream)
          Verifies an XML file against an XSD and instantiates it using a given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlLoader

public XmlLoader()
Method Detail

loadSchemaAndFile

public static <T> T loadSchemaAndFile(java.lang.String xsdPath,
                                      java.lang.Class<T> rootClass,
                                      java.io.InputStream xmlInputStream)
                           throws java.lang.Exception
Verifies an XML file against an XSD and instantiates it using a given class.

Parameters:
xsdPath - XSD file path.
xmlRoot - Root element of the XML
xmlInputStream - XML to load.
Returns:
XML loaded using JAXB and the rootClass.
Throws:
java.lang.Exception - If creating the schema or parsing the XML fails.



Copyright © 2010 OW2 Consortium. All Rights Reserved.
Apache Camel version 2.3.0, OW2 JOnAS version 5.2.0-M2-SR1