psdi.app.bim.parser.cobie

Class XmlnputTokenizer

  • java.lang.Object
    • psdi.app.bim.parser.cobie.XmlnputTokenizer


  • public class XmlnputTokenizer
    extends java.lang.Object
    A class that contains a set of XML-handling utility methods All methods of this class are static
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.List find(java.lang.String query) 
      XmlnputTokenizer findElement(java.lang.String query) 
      java.lang.String getAttribute(java.lang.String attrName)
      Returns the value of the xml attribute with the given name that is contained in the given node
      XmlnputTokenizer getChild(java.lang.String name)
      Reads the child node which has the given name from the given parent node This method assumes that there is a single child node with the given name under the given parent node, otherwise the first child found is returned
      java.util.List getChildren(java.lang.String name)
      Returns the list of child nodes that have the given name from the given parent node
      java.lang.String getChildValue(java.lang.String childName)
      Reads the text value contained in the given child node
      java.lang.String getName() 
      java.lang.String getXML() 
      static XmlnputTokenizer parse(org.xml.sax.InputSource in)
      Parses the XML file contained in the given input source and reads the main Document node which is returned from this method
      static XmlnputTokenizer parse(java.io.InputStream in)
      Parses the XML file contained in the given input stream and reads the main Document node which is returned from this method
      static XmlnputTokenizer parse(java.io.Reader in)
      Parses the XML file contained in the given input stream and reads the main Document node which is returned from this method
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parse

        public static XmlnputTokenizer parse(java.io.Reader in)
                                      throws java.lang.Exception
        Parses the XML file contained in the given input stream and reads the main Document node which is returned from this method
        Parameters:
        in - the reader to read the XML data from
        Returns:
        the Document object which represents the root Node of the XML
        Throws:
        java.lang.Exception - if an error occurs during parsing of the xml
      • parse

        public static XmlnputTokenizer parse(java.io.InputStream in)
                                      throws java.lang.Exception
        Parses the XML file contained in the given input stream and reads the main Document node which is returned from this method
        Parameters:
        in - the input stream to read the XML data from
        Returns:
        the Document object which represents the root Node of the XML
        Throws:
        java.lang.Exception - if an error occurs during parsing of the xml
      • parse

        public static XmlnputTokenizer parse(org.xml.sax.InputSource in)
                                      throws java.lang.Exception
        Parses the XML file contained in the given input source and reads the main Document node which is returned from this method
        Parameters:
        in - the input source to read the XML data from
        Returns:
        the Document object which represents the root Node of the XML
        Throws:
        java.lang.Exception - if an error occurs during parsing of the xml
      • getChild

        public XmlnputTokenizer getChild(java.lang.String name)
        Reads the child node which has the given name from the given parent node This method assumes that there is a single child node with the given name under the given parent node, otherwise the first child found is returned
        Parameters:
        node - the parent node to read the child from
        name - the name of the child node to read
        Returns:
        the child node
      • getChildren

        public java.util.List getChildren(java.lang.String name)
        Returns the list of child nodes that have the given name from the given parent node
        Parameters:
        node - the parent node to read the child nodes from
        name - the name of the child nodes to read
        Returns:
        the list of child nodes
      • find

        public java.util.List find(java.lang.String query)
                            throws javax.xml.xpath.XPathException
        Throws:
        javax.xml.xpath.XPathException
      • findElement

        public XmlnputTokenizer findElement(java.lang.String query)
                                     throws javax.xml.xpath.XPathException
        Throws:
        javax.xml.xpath.XPathException
      • getAttribute

        public java.lang.String getAttribute(java.lang.String attrName)
        Returns the value of the xml attribute with the given name that is contained in the given node
        Parameters:
        node - the node to read the attribute from
        attrName - the name of the attribute whose value is to be retrieved
        Returns:
        the value corresponding to the given attribute
      • getChildValue

        public java.lang.String getChildValue(java.lang.String childName)
        Reads the text value contained in the given child node
        Parameters:
        node - the parent node to read the child node from
        childName - the name of the child node whose text value is to be retrieved
        Returns:
        the text value of the child node
      • getName

        public java.lang.String getName()
      • getXML

        public java.lang.String getXML()
                                throws javax.xml.transform.TransformerException,
                                       javax.xml.transform.TransformerConfigurationException
        Throws:
        javax.xml.transform.TransformerException
        javax.xml.transform.TransformerConfigurationException