com.x5.util
Class LiteXml

java.lang.Object
  extended by com.x5.util.LiteXml

public class LiteXml
extends java.lang.Object


Constructor Summary
LiteXml(java.lang.String xmlNode)
           
 
Method Summary
 LiteXml findChildNode(java.lang.String branchPath)
           
 LiteXml findNode(java.lang.String xpathLite)
           
 LiteXml findNode(java.lang.String[] xpathLite)
           
 java.lang.String getAttribute(java.lang.String attr)
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 LiteXml[] getChildNodes()
          There are two things that make this class lightweight.
 LiteXml[] getChildNodes(java.lang.String nodeType)
          getChildNodes(nodeType) shares the limitations of the method below.
 LiteXml getFirstChild()
           
 java.lang.String getNodeType()
           
 java.lang.String getNodeValue()
           
 java.lang.String getNodeValue(java.lang.String branchPath)
           
 java.lang.String getPathValue(java.lang.String xpathLite)
           
static int nextUnescapedDelim(java.lang.String delim, java.lang.String toScan, int searchFrom)
           
 java.lang.String toString()
           
static java.lang.String unescapeXML(java.lang.String xml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiteXml

public LiteXml(java.lang.String xmlNode)
Method Detail

getNodeType

public java.lang.String getNodeType()

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()

nextUnescapedDelim

public static int nextUnescapedDelim(java.lang.String delim,
                                     java.lang.String toScan,
                                     int searchFrom)

getAttribute

public java.lang.String getAttribute(java.lang.String attr)

getNodeValue

public java.lang.String getNodeValue()

getChildNodes

public LiteXml[] getChildNodes(java.lang.String nodeType)
getChildNodes(nodeType) shares the limitations of the method below. only returns nodes which match specified nodetype.

Parameters:
nodeType -
Returns:
matching child nodes as an array of LiteXml objects

getChildNodes

public LiteXml[] getChildNodes()
There are two things that make this class lightweight. One is extremely limited support for xpath and zero support for namespaces. The other is the fact that instead of building a vector or arraylist to handle a potentially large number of child nodes, we build an array of child node positions that doubles in size as capacity needs increase.

Returns:
any child nodes as an array of LiteXml objects

getFirstChild

public LiteXml getFirstChild()

getPathValue

public java.lang.String getPathValue(java.lang.String xpathLite)

getNodeValue

public java.lang.String getNodeValue(java.lang.String branchPath)

findChildNode

public LiteXml findChildNode(java.lang.String branchPath)

findNode

public LiteXml findNode(java.lang.String xpathLite)

findNode

public LiteXml findNode(java.lang.String[] xpathLite)

unescapeXML

public static java.lang.String unescapeXML(java.lang.String xml)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2015. All Rights Reserved.