com.supermap.services.providers
Class DocumentParserTool
- java.lang.Object
-
- com.supermap.services.providers.DocumentParserTool
-
public final class DocumentParserTool extends java.lang.ObjectXML document parsing tool class.
-
-
Constructor Summary
Constructors Constructor and Description DocumentParserTool()
-
Method Summary
Methods Modifier and Type Method and Description static voidcheckAttributeValue(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 voidcheckNode(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.XPathcreateXPath(javax.xml.namespace.NamespaceContext context)Create an XPath object from the namespace context.
-
-
-
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 ParseExceptionCheck 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 ParseExceptionCheck 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
-
-