com.supermap.ar.areffect.utils

Class XmlNodeParser

  • java.lang.Object
    • com.supermap.ar.areffect.utils.XmlNodeParser


  • public class XmlNodeParser
    extends java.lang.Object
    The XML parser

    Used to parse XML

    SampleCode:
                 XmlNode xmlNode = new XmlNodeParser().parse(file);
                 ArrayList xmlNodeList = xmlNode.getXmlNode("sml:MapBounds");
     
    • Constructor Summary

      Constructors 
      Constructor and Description
      XmlNodeParser()
      The constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.ArrayList<XmlNode> findXmlNode(XmlNode parentXmlNode, java.lang.String name)
      Finds the specified node in the parent node by specifying its name is usually used to find the specified object and then get its parent node by XmlNode.getParent()
      XmlNode parse(java.io.File xmlFile)
      Parsing XML files
      XmlNode parse(java.lang.String string)
      Parsing XML strings
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlNodeParser

        public XmlNodeParser()
        The constructor
    • Method Detail

      • parse

        public XmlNode parse(java.io.File xmlFile)
                      throws java.io.IOException,
                             javax.xml.parsers.ParserConfigurationException,
                             org.xml.sax.SAXException
        Parsing XML files
        Parameters:
        xmlFile -
        Returns:
        Throws:
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
      • parse

        public XmlNode parse(java.lang.String string)
                      throws javax.xml.parsers.ParserConfigurationException,
                             java.io.IOException,
                             org.xml.sax.SAXException
        Parsing XML strings
        Parameters:
        string - xml string
        Returns:
        Throws:
        javax.xml.parsers.ParserConfigurationException
        java.io.IOException
        org.xml.sax.SAXException
      • findXmlNode

        public java.util.ArrayList<XmlNode> findXmlNode(XmlNode parentXmlNode,
                                                        java.lang.String name)
        Finds the specified node in the parent node by specifying its name

        is usually used to find the specified object and then get its parent node by XmlNode.getParent()

        Parameters:
        parentXmlNode -
        name -
        Returns:
        Child nodes