/** * Constructs a new XMap instance. * * @param root the name of the root element (may be null). */ public XMap(String root) { if (root != null) { this.root = getXMLUtil().newDocument(root).getDocumentElement(); } }
/** * Returns a "pretty" XML representation of the root element of this XMap (may be null). * * @return a "pretty" XML representation of the root element of this XMap (may be null). */ @Override public String toString() { return getXMLUtil().toNodeString(root); }
/** * Returns a "pretty" XML representation of the root element of this XMap (may be null). * * @return a "pretty" XML representation of the root element of this XMap (may be null). */ @Override public String toString() { return getXMLUtil().toNodeString(root); }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input, EntityResolver resolver) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input, resolver, null).getDocumentElement(); }
/** * Constructs a new XMap instance. * * @param root the name of the root element (may be null). */ public XMap(String root) { if (root != null) { this.root = getXMLUtil().newDocument(root).getDocumentElement(); } }
/** * Constructs a new XMap instance. * * @param root the name of the root element (may be null). */ public XMap(String root) { if (root != null) { this.root = getXMLUtil().newDocument(root).getDocumentElement(); } }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input, EntityResolver resolver) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input, resolver, null).getDocumentElement(); }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input).getDocumentElement(); }
/** * Returns a "pretty" XML representation of the root element of this XMap (may be null). * * @return a "pretty" XML representation of the root element of this XMap (may be null). */ @Override public String toString() { return getXMLUtil().toNodeString(root); }
/** * Returns a "pretty" XML representation of the root element of this XMap (may be null). * * @return a "pretty" XML representation of the root element of this XMap (may be null). */ @Override public String toString() { return getXMLUtil().toNodeString(root); }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input).getDocumentElement(); }
/** * Constructs a new XMap instance. * * @param root the name of the root element (may be null). */ public XMap(String root) { if (root != null) { this.root = getXMLUtil().newDocument(root).getDocumentElement(); } }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input).getDocumentElement(); }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input, EntityResolver resolver) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input, resolver, null).getDocumentElement(); }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input).getDocumentElement(); }
/** * Constructs a new XMap instance from an XML input stream. * * @param input an XML input stream. */ public XMap(InputStream input, EntityResolver resolver) throws IOException, SAXException { this.root = getXMLUtil().loadDocument(input, resolver, null).getDocumentElement(); }
/** * Returns the text value of the element (or attribute or text) that matches the supplied * XPath expression. * * @param key an XPath expression. * @return the text value of the matched element or null if the element does not exist or have * no value. * @throws RuntimeException if the XPath expression isn't correct. */ public String get(String key) { if (root == null) return null; try { return getXMLUtil().getNormalizedValue(getXMLUtil().selectSingleNode(root, key)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns the text value of the element (or attribute or text) that matches the supplied * XPath expression. * * @param key an XPath expression. * @return the text value of the matched element or null if the element does not exist or have * no value. * @throws RuntimeException if the XPath expression isn't correct. */ public String get(String key) { if (root == null) return null; try { return getXMLUtil().getNormalizedValue(getXMLUtil().selectSingleNode(root, key)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns the text value of the element (or attribute or text) that matches the supplied * XPath expression. * * @param key an XPath expression. * @return the text value of the matched element or null if the element does not exist or have * no value. * @throws RuntimeException if the XPath expression isn't correct. */ public String get(String key) { if (root == null) return null; try { return getXMLUtil().getNormalizedValue(getXMLUtil().selectSingleNode(root, key)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns the text value of the element (or attribute or text) that matches the supplied * XPath expression. * * @param key an XPath expression. * @return the text value of the matched element or null if the element does not exist or have * no value. * @throws RuntimeException if the XPath expression isn't correct. */ public String get(String key) { if (root == null) return null; try { return getXMLUtil().getNormalizedValue(getXMLUtil().selectSingleNode(root, key)); } catch (Exception e) { throw new RuntimeException(e); } }