com.supermap.services.providers

Class DocumentParserTool

  • java.lang.Object
    • com.supermap.services.providers.DocumentParserTool


  • public final class DocumentParserTool
    extends java.lang.Object
    

    XML document parsing tool class.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static void checkAttributeValue(java.lang.String value, java.lang.String msg)
      Check whether the attribute value of the node is empty, if it is empty, then throw the specified information of the document resolution exception.
      static void checkNode(org.w3c.dom.Node node, java.lang.String msg)
      Check if the XML node is null, and if it is null, the document resolution exception for the specified information is thrown.
      static javax.xml.xpath.XPath createXPath(javax.xml.namespace.NamespaceContext context)
      Create an XPath object from the namespace context.
      • Methods inherited from class java.lang.Object

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

      • DocumentParserTool

        public DocumentParserTool()
        
    • Method Detail

      • createXPath

        public static javax.xml.xpath.XPath createXPath(javax.xml.namespace.NamespaceContext context)
        

        Create an XPath object from the namespace context.

        Parameters:
        context - Namespace context.
        Returns:
        XPath object.
      • checkNode

        public static void checkNode(org.w3c.dom.Node node,
                     java.lang.String msg)
                              throws ParseException
        

        Check if the XML node is null, and if it is null, the document resolution exception for the specified information is thrown.

        Parameters:
        node, - the XML node to judge.
        msg, - the exception information when the node is null.
        Throws:
        ParseException, - if the node is null, the document resolution exception for the specified information is thrown.
        ParseException
      • checkAttributeValue

        public static void checkAttributeValue(java.lang.String value,
                               java.lang.String msg)
                                        throws ParseException
        

        Check whether the attribute value of the node is empty, if it is empty, then throw the specified information of the document resolution exception.

        If the attribute value is empty, it is null, the string length is 0, or the string is blank.

        Parameters:
        value, - the node attribute value to determine.
        msg, - the exception detail information when the node is null.
        Throws:
        ParseException, - if the node attribute value is empty, the XML document parsing exception is thrown.
        ParseException