HPSearch

cgl.hpsearch.nb4ws.WSDL
Class XMLUtils

java.lang.Object
  extended bycgl.hpsearch.nb4ws.WSDL.XMLUtils

public class XMLUtils
extends Object

XML support and utilities

Author:
Bikash Behera, Jim Winfield

Method Summary
static org.exolab.castor.xml.schema.Schema convertElementToSchema(Element element)
          Converts the jdom element into a castor schema.
static Element convertSchemaToElement(org.exolab.castor.xml.schema.Schema schema)
          Converts a castor schema into a jdom element.
static String outputString(Document doc)
          Returns a string representation of the given jdom document.
static String outputString(Element elem)
          Returns a string representation of the given jdom element.
static String outputString(org.exolab.castor.xml.schema.Schema schema)
          Returns a string representation of the given castor schema.
static org.exolab.castor.xml.schema.Schema readSchema(Reader reader)
          It reads the given reader and returns the castor schema.
static Document readXML(Reader reader)
          It reads the given xml reader and returns the jdom document.
static Document readXML(String xml)
          It reads the given xml returns the jdom document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

outputString

public static String outputString(Document doc)
Returns a string representation of the given jdom document.

Parameters:
doc - The jdom document to be converted into a string.
Returns:
Ths string representation of the given jdom document.

outputString

public static String outputString(Element elem)
Returns a string representation of the given jdom element.

Parameters:
elem - The jdom element to be converted into a string.
Returns:
The string representation of the given jdom element.

readXML

public static Document readXML(String xml)
                        throws JDOMException,
                               IOException
It reads the given xml returns the jdom document.

Parameters:
xml - The xml to read.
Returns:
The jdom document created from the xml.
Throws:
JDOMException - If the parsing failed.
IOException

readXML

public static Document readXML(Reader reader)
                        throws JDOMException,
                               IOException
It reads the given xml reader and returns the jdom document.

Parameters:
reader - The xml reader to read.
Returns:
The jdom document created from the xml reader.
Throws:
JDOMException - If the parsing failed.
IOException

readSchema

public static org.exolab.castor.xml.schema.Schema readSchema(Reader reader)
                                                      throws IOException
It reads the given reader and returns the castor schema.

Parameters:
reader - The reader to read.
Returns:
The castor schema created from the reader.
Throws:
IOException - If the schema could not be read from the reader.

convertSchemaToElement

public static Element convertSchemaToElement(org.exolab.castor.xml.schema.Schema schema)
                                      throws SAXException,
                                             IOException,
                                             JDOMException
Converts a castor schema into a jdom element.

Parameters:
schema - The castor schema to be converted.
Returns:
The jdom element representing the schema.
Throws:
SAXException - If the castor schema could not be written out.
IOException - If the castor schema could not be written out.
JDOMException - If the output of the castor schema could not be converted into a jdom element.

convertElementToSchema

public static org.exolab.castor.xml.schema.Schema convertElementToSchema(Element element)
                                                                  throws IOException
Converts the jdom element into a castor schema.

Parameters:
element - The jdom element to be converted into a castor schema.
Returns:
The castor schema corresponding to the element.
Throws:
IOException - If the jdom element could not be written out.

outputString

public static String outputString(org.exolab.castor.xml.schema.Schema schema)
                           throws IOException,
                                  SAXException
Returns a string representation of the given castor schema.

Parameters:
schema - The castor schema to be converted into a string.
Returns:
The string representation of the given castor schema.
Throws:
IOException - If the schema could not be written out.
SAXException - If the schema could not be written out.

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006