endrov.util.io
Class EvXmlUtil

java.lang.Object
  extended by endrov.util.io.EvXmlUtil

public class EvXmlUtil
extends java.lang.Object

Utility functions for XML


Nested Class Summary
static class EvXmlUtil.NoOpEntityResolver
           
 
Constructor Summary
EvXmlUtil()
           
 
Method Summary
static void element2matrix(org.jdom.Element e, javax.vecmath.Matrix3d v)
           
static void element2vector(org.jdom.Element e, javax.vecmath.Vector3d v)
           
static boolean elementsEqual(org.jdom.Element a, org.jdom.Element b)
          Checks if name and attributes equal, not content
static java.util.List<org.jdom.Element> getChildrenE(org.jdom.Element root)
           
static java.util.List<org.jdom.Element> getChildrenE(org.jdom.Element root, java.lang.String name)
           
static void matrix2element(org.jdom.Element e, javax.vecmath.Matrix3d v)
           
static void mergeXML(org.jdom.Element to, org.jdom.Element from)
          Merge two XML-documents
static java.lang.String prettyPrint(org.jdom.Element e)
           
static void prettyPrint(org.jdom.Element e, java.lang.StringBuffer b)
           
static org.jdom.Document readXML(java.io.File filename)
           
static org.jdom.Document readXML(java.io.Reader c)
           
static org.jdom.Element stringToXml(java.lang.String s)
           
static void vector2element(org.jdom.Element e, javax.vecmath.Vector3d v)
           
static void writeXmlData(org.jdom.Document doc, java.io.File file)
          Write XML-document to disk
static void writeXmlData(org.jdom.Document doc, java.io.OutputStream os)
          Write XML-document to stream
static java.lang.String xmlToString(org.jdom.Document doc)
          Write XML-document to disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvXmlUtil

public EvXmlUtil()
Method Detail

readXML

public static org.jdom.Document readXML(java.io.File filename)
                                 throws java.io.IOException,
                                        org.jdom.JDOMException
Throws:
java.io.IOException
org.jdom.JDOMException

readXML

public static org.jdom.Document readXML(java.io.Reader c)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getChildrenE

public static java.util.List<org.jdom.Element> getChildrenE(org.jdom.Element root,
                                                            java.lang.String name)

getChildrenE

public static java.util.List<org.jdom.Element> getChildrenE(org.jdom.Element root)

prettyPrint

public static java.lang.String prettyPrint(org.jdom.Element e)

prettyPrint

public static void prettyPrint(org.jdom.Element e,
                               java.lang.StringBuffer b)

elementsEqual

public static boolean elementsEqual(org.jdom.Element a,
                                    org.jdom.Element b)
Checks if name and attributes equal, not content


mergeXML

public static void mergeXML(org.jdom.Element to,
                            org.jdom.Element from)
Merge two XML-documents

Parameters:
to -
from -

writeXmlData

public static void writeXmlData(org.jdom.Document doc,
                                java.io.File file)
                         throws java.lang.Exception
Write XML-document to disk

Throws:
java.lang.Exception

writeXmlData

public static void writeXmlData(org.jdom.Document doc,
                                java.io.OutputStream os)
                         throws java.lang.Exception
Write XML-document to stream

Throws:
java.lang.Exception

xmlToString

public static java.lang.String xmlToString(org.jdom.Document doc)
                                    throws java.lang.Exception
Write XML-document to disk

Throws:
java.lang.Exception

stringToXml

public static org.jdom.Element stringToXml(java.lang.String s)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

vector2element

public static void vector2element(org.jdom.Element e,
                                  javax.vecmath.Vector3d v)

element2vector

public static void element2vector(org.jdom.Element e,
                                  javax.vecmath.Vector3d v)

matrix2element

public static void matrix2element(org.jdom.Element e,
                                  javax.vecmath.Matrix3d v)

element2matrix

public static void element2matrix(org.jdom.Element e,
                                  javax.vecmath.Matrix3d v)