|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.util.XpathUtils
public class XpathUtils
Utility methods for extracting data from XML documents using Xpath expressions.
Constructor Summary | |
---|---|
XpathUtils()
|
Method Summary | |
---|---|
static Boolean |
asBoolean(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as a Boolean. |
static Byte |
asByte(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as a Byte. |
static ByteBuffer |
asByteBuffer(String expression,
Node node)
Evaluates the specified xpath expression, base64 decodes the data and returns the result as a ByteBuffer. |
static Date |
asDate(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as a Date. |
static Double |
asDouble(String expression,
Node node)
Evaluates the specified XPath expression and returns the results as a Double. |
static Float |
asFloat(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as a Float. |
static Integer |
asInteger(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as an Integer. |
static Long |
asLong(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as a Long. |
static Node |
asNode(String nodeName,
Node node)
Evaluates the specified XPath expression and returns the result as a Node. |
static String |
asString(String expression,
Node node)
Evaluates the specified XPath expression and returns the result as a string. |
static Document |
documentFrom(InputStream is)
|
static Document |
documentFrom(String xml)
|
static Document |
documentFrom(URL url)
|
static boolean |
isEmpty(Node node)
Returns true if the specified node is null or has no children. |
static int |
nodeLength(NodeList list)
Returns the length of the specified node list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XpathUtils()
Method Detail |
---|
public static Document documentFrom(InputStream is) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
public static Document documentFrom(String xml) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
public static Document documentFrom(URL url) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
public static Double asDouble(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static String asString(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static Integer asInteger(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static Boolean asBoolean(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static Float asFloat(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static Long asLong(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static Byte asByte(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static Date asDate(String expression, Node node) throws XPathExpressionException
expression
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static ByteBuffer asByteBuffer(String expression, Node node) throws XPathExpressionException
expression
- The Xpath expression to evaluate.node
- The node on which to evaluate the expression.
XPathExpressionException
- If there are any problems evaluating the Xpath expression.public static boolean isEmpty(Node node)
node
- The node to test.
public static Node asNode(String nodeName, Node node) throws XPathExpressionException
nodeName
- The XPath expression to evaluate.node
- The node to run the expression on.
XPathExpressionException
- If there was a problem processing the specified XPath
expression.public static int nodeLength(NodeList list)
list
- The node list to measure.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |