@Test public void testAsByteBuffer() throws Exception { String expectedData = "hello world"; Document document = XpathUtils.documentFrom(DOCUMENT); XPath xpath = XpathUtils.xpath(); ByteBuffer byteBuffer = asByteBuffer("Foo/Blob", document, xpath); assertEquals(expectedData.length(), byteBuffer.limit()); String data = new String(byteBuffer.array()); assertEquals(expectedData, data); assertEquals(null, asByteBuffer("Foo/Empty", document, xpath)); }
public static ByteBuffer asByteBuffer(String expression, Node node) throws XPathExpressionException { return asByteBuffer(expression, node, xpath()); }
XpathUtils { public static ByteBuffer asByteBuffer(String expression, Node node) throws XPathExpressionException { return asByteBuffer(expression, node, xpath()); } }
XpathUtils { public static ByteBuffer asByteBuffer(String expression, Node node) throws XPathExpressionException { return asByteBuffer(expression, node, xpath()); }  }
XpathUtils { public static ByteBuffer asByteBuffer(String expression, Node node) throws XPathExpressionException { return asByteBuffer(expression, node, xpath()); }  static XPath xpath(); static Document documentFrom(InputStream is); static Document documentFrom(String xml); static Document documentFrom(URL url); static Double asDouble(String expression, Node node); static Double asDouble(String expression, Node node, XPath xpath); static String asString(String expression, Node node); static String asString(String expression, Node node, XPath xpath); static Integer asInteger(String expression, Node node); static Integer asInteger(String expression, Node node, XPath xpath); static Boolean asBoolean(String expression, Node node); static Boolean asBoolean(String expression, Node node, XPath xpath); static Float asFloat(String expression, Node node); static Float asFloat(String expression, Node node, XPath xpath); static Long asLong(String expression, Node node); static Long asLong(String expression, Node node, XPath xpath); static Byte asByte(String expression, Node node); static Byte asByte(String expression, Node node, XPath xpath); static Date asDate(String expression, Node node); static Date asDate(String expression, Node node, XPath xpath); static ByteBuffer asByteBuffer(String expression, Node node); static ByteBuffer asByteBuffer(String expression, Node node, XPath xpath); static boolean isEmpty(Node node); static Node asNode(String nodeName, Node node); static Node asNode(String nodeName, Node node, XPath xpath); static int nodeLength(NodeList list); }
XpathUtils { public static ByteBuffer asByteBuffer(String expression, Node node) throws XPathExpressionException { return asByteBuffer(expression, node, xpath()); }  static XPath xpath(); static Document documentFrom(InputStream is); static Document documentFrom(String xml); static Document documentFrom(URL url); static Double asDouble(String expression, Node node); static Double asDouble(String expression, Node node, XPath xpath); static String asString(String expression, Node node); static String asString(String expression, Node node, XPath xpath); static Integer asInteger(String expression, Node node); static Integer asInteger(String expression, Node node, XPath xpath); static Boolean asBoolean(String expression, Node node); static Boolean asBoolean(String expression, Node node, XPath xpath); static Float asFloat(String expression, Node node); static Float asFloat(String expression, Node node, XPath xpath); static Long asLong(String expression, Node node); static Long asLong(String expression, Node node, XPath xpath); static Byte asByte(String expression, Node node); static Byte asByte(String expression, Node node, XPath xpath); static Date asDate(String expression, Node node); static Date asDate(String expression, Node node, XPath xpath); static ByteBuffer asByteBuffer(String expression, Node node); static ByteBuffer asByteBuffer(String expression, Node node, XPath xpath); static boolean isEmpty(Node node); static Node asNode(String nodeName, Node node); static Node asNode(String nodeName, Node node, XPath xpath); static int nodeLength(NodeList list);  }