org.jboss.messaging.utils
Class XMLUtil

java.lang.Object
  extended by org.jboss.messaging.utils.XMLUtil

public class XMLUtil
extends java.lang.Object

Version:
$Revision: 6966 $ $Id: XMLUtil.java 6966 2009-05-21 13:50:51Z timfox $
Author:
Ovidiu Feodorov, Tim Fox

Constructor Summary
XMLUtil()
           
 
Method Summary
static void assertEquivalent(org.w3c.dom.Node node, org.w3c.dom.Node node2)
           
static java.lang.String elementToString(org.w3c.dom.Node n)
           
static java.lang.String getTextContent(org.w3c.dom.Node n)
          This metod is here because Node.getTextContent() is not available in JDK 1.4 and I would like to have an uniform access to this functionality.
static boolean parseBoolean(org.w3c.dom.Node elem)
           
static double parseDouble(org.w3c.dom.Node elem)
           
static int parseInt(org.w3c.dom.Node elem)
           
static long parseLong(org.w3c.dom.Node elem)
           
static org.w3c.dom.Element readerToElement(java.io.Reader r)
           
static java.lang.String readerToString(java.io.Reader r)
           
static java.lang.String replaceSystemProps(java.lang.String xml)
           
static org.w3c.dom.Element stringToElement(java.lang.String s)
           
static java.lang.String stripCDATA(java.lang.String s)
           
static org.w3c.dom.Element urlToElement(java.net.URL url)
           
static void validate(org.w3c.dom.Node node, java.lang.String schemaFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtil

public XMLUtil()
Method Detail

stringToElement

public static org.w3c.dom.Element stringToElement(java.lang.String s)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

urlToElement

public static org.w3c.dom.Element urlToElement(java.net.URL url)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

readerToString

public static java.lang.String readerToString(java.io.Reader r)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

readerToElement

public static org.w3c.dom.Element readerToElement(java.io.Reader r)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

elementToString

public static java.lang.String elementToString(org.w3c.dom.Node n)

getTextContent

public static java.lang.String getTextContent(org.w3c.dom.Node n)
This metod is here because Node.getTextContent() is not available in JDK 1.4 and I would like to have an uniform access to this functionality. Note: if the content is another element or set of elements, it returns a string representation of the hierarchy. TODO implementation of this method is a hack. Implement it properly.


assertEquivalent

public static void assertEquivalent(org.w3c.dom.Node node,
                                    org.w3c.dom.Node node2)

stripCDATA

public static java.lang.String stripCDATA(java.lang.String s)

replaceSystemProps

public static java.lang.String replaceSystemProps(java.lang.String xml)

parseLong

public static long parseLong(org.w3c.dom.Node elem)

parseInt

public static int parseInt(org.w3c.dom.Node elem)

parseBoolean

public static boolean parseBoolean(org.w3c.dom.Node elem)

parseDouble

public static double parseDouble(org.w3c.dom.Node elem)

validate

public static void validate(org.w3c.dom.Node node,
                            java.lang.String schemaFile)
                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2006 JBoss Inc. All Rights Reserved.