| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_181) on Wed Oct 10 00:41:13 CEST 2018 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>XmlTool (VelocityTools 3.0 API)</title> |
| <meta name="date" content="2018-10-10"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="XmlTool (VelocityTools 3.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/XmlTool.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/velocity/tools/generic/XmlTool.html" target="_top">Frames</a></li> |
| <li><a href="XmlTool.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.velocity.tools.generic</div> |
| <h2 title="Class XmlTool" class="title">Class XmlTool</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.velocity.tools.generic.XmlTool</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../../org/apache/velocity/tools/view/XmlTool.html" title="class in org.apache.velocity.tools.view">XmlTool</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre><a href="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</a>(<a href="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value--">value</a>="xml") |
| public class <span class="typeNameLabel">XmlTool</span> |
| extends <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a> |
| implements <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre> |
| <div class="block"><p>Tool for reading/navigating XML files. This uses dom4j under the |
| covers to provide complete XPath support for traversing XML files.</p> |
| <p>Configuration parameters:</p> |
| <ul> |
| <li><code>resource</code>=<i>file or classpath resource</i></li> |
| <li><code>source</code>=<i>URL</i></li> |
| </ul> |
| |
| <p>Here's a short example:</p> |
| <pre> |
| XML file: |
| <foo><bar>woogie</bar><a name="test"/></foo> |
| |
| Template: |
| $foo.bar.text |
| $foo.find('a') |
| $foo.a.name |
| |
| Output: |
| woogie |
| <a name="test"/> |
| test |
| |
| Configuration: |
| <tools> |
| <toolbox scope="application"> |
| <tool class="org.apache.velocity.tools.generic.XmlTool" |
| key="foo" source="doc.xml"/> |
| </toolbox> |
| </tools> |
| </pre> |
| <p>Note that this tool is included in the default GenericTools configuration |
| under the key "xml". You can read but unless you set safeMode="false" for it, you will |
| only be able to parse XML strings. Safe mode is on by default and blocks |
| access to the <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read-java.lang.String-"><code>read(String)</code></a> method.</p></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 2.0</dd> |
| <dt><span class="simpleTagLabel">Version:</span></dt> |
| <dd>$Revision: 1769055 $ $Date: 2006-11-27 10:49:37 -0800 (Mon, 27 Nov 2006) $</dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Nathan Bubna, Claude Brisson</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../serialized-form.html#org.apache.velocity.tools.generic.XmlTool">Serialized Form</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic">XmlTool.NodeIterator</a></span></code> |
| <div class="block">Iterator implementation that wraps a Node list iterator |
| to return new XmlTool instances for each item in the wrapped |
| iterator.s</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/velocity/tools/generic/ImportSupport.html" title="class in org.apache.velocity.tools.generic">ImportSupport</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#importSupport">importSupport</a></span></code> |
| <div class="block">ImportSupport utility which provides underlying i/o</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3> |
| <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOCK_CONFIG_KEY">LOCK_CONFIG_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#log">log</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOGGER_NAME_KEY">LOGGER_NAME_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#USE_CLASS_LOGGER_KEY">USE_CLASS_LOGGER_KEY</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#XmlTool--">XmlTool</a></span>()</code> |
| <div class="block">Default constructor.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#XmlTool-java.util.List-">XmlTool</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>> nodes)</code> |
| <div class="block">Builds an XmlTool around a nodes list.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#XmlTool-org.w3c.dom.Node-">XmlTool</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a> node)</code> |
| <div class="block">Builds an XmlTool around a node.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#attr-java.lang.Object-">attr</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</code> |
| <div class="block">Returns the value of the specified attribute for the first/sole |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> in the internal Node list for this instance, if that |
| Node is an <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#attributes--">attributes</a></span>()</code> |
| <div class="block">Returns a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><code>Map</code></a> of all attributes for the first/sole |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> held internally by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#children--">children</a></span>()</code> |
| <div class="block">Returns a new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps all the |
| child <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>s of all the current internally held nodes |
| that are <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>s themselves.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></span>(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a> values)</code> |
| <div class="block">Configuration.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#fetch-java.lang.String-">fetch</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> url)</code> |
| <div class="block">Reads and parses a remote or local URL</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find-java.lang.Object-">find</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</code> |
| <div class="block">Converts the specified object to a String and calls |
| <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find-java.lang.String-"><code>find(String)</code></a> with that.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find-java.lang.String-">find</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> xpath)</code> |
| <div class="block">Performs an XPath selection on the current set of |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s held by this instance and returns a new |
| <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps those results.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get-java.lang.Number-">get</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a> n)</code> |
| <div class="block">Returns an <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> that wraps the specified |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this instance's internal Node list.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get-java.lang.Object-">get</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</code> |
| <div class="block">This will first attempt to find an attribute with the |
| specified name and return its value.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getFirst--">getFirst</a></span>()</code> |
| <div class="block">Returns an <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> that wraps only the |
| first <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this instance's internal Node list.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getLast--">getLast</a></span>()</code> |
| <div class="block">Returns an <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> that wraps only the |
| last <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this instance's internal Node list.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getName--">getName</a></span>()</code> |
| <div class="block">Asks <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get-java.lang.Object-"><code>get(Object)</code></a> for a "name" result.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getNodeName--">getNodeName</a></span>()</code> |
| <div class="block">Returns the name of the root node.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getParent--">getParent</a></span>()</code> |
| <div class="block">Returns a new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps |
| the parent <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a> of the first/sole <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> |
| being wrapped by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getPath--">getPath</a></span>()</code> |
| <div class="block">Returns the XPath that identifies the first/sole <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> |
| represented by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getText--">getText</a></span>()</code> |
| <div class="block">Returns the concatenated text content of all the internally held |
| nodes.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#initializeImportSupport-org.apache.velocity.tools.generic.ValueParser-">initializeImportSupport</a></span>(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a> config)</code> |
| <div class="block">ImportSupport initialization</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#isEmpty--">isEmpty</a></span>()</code> |
| <div class="block">Returns <code>true</code> if there are no <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s internally held |
| by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#iterator--">iterator</a></span>()</code> |
| <div class="block">Returns an <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util"><code>Iterator</code></a> that returns new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> |
| instances for each <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> held internally by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#node--">node</a></span>()</code> |
| <div class="block">Returns the first/sole <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this |
| instance's internal Node list, if any.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#parents--">parents</a></span>()</code> |
| <div class="block">Returns a new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps |
| the parent <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>s of each of the <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s |
| being wrapped by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#parse-java.lang.String-">parse</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> xml)</code> |
| <div class="block">Parses the given XML string and uses the resulting <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom"><code>Document</code></a> |
| as the root <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read-java.lang.String-">read</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resource)</code> |
| <div class="block">Reads and parses a local resource file</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#setRoot-org.w3c.dom.Node-">setRoot</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a> node)</code> |
| <div class="block">Sets a singular root <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> for this instance.</div> |
| </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#size--">size</a></span>()</code> |
| <div class="block">Returns the number of <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s internally held by this instance.</div> |
| </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#toString--">toString</a></span>()</code> |
| <div class="block">If this instance has no XML <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s, then this |
| returns the result of <code>super.toString()</code>.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3> |
| <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-java.util.Map-">configure</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#getLog--">getLog</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#initLogger-org.apache.velocity.tools.generic.ValueParser-">initLogger</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isConfigLocked--">isConfigLocked</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isSafeMode--">isSafeMode</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setLockConfig-boolean-">setLockConfig</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setSafeMode-boolean-">setSafeMode</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="importSupport"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>importSupport</h4> |
| <pre>protected transient <a href="../../../../../org/apache/velocity/tools/generic/ImportSupport.html" title="class in org.apache.velocity.tools.generic">ImportSupport</a> importSupport</pre> |
| <div class="block">ImportSupport utility which provides underlying i/o</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="XmlTool--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>XmlTool</h4> |
| <pre>public XmlTool()</pre> |
| <div class="block">Default constructor.</div> |
| </li> |
| </ul> |
| <a name="XmlTool-org.w3c.dom.Node-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>XmlTool</h4> |
| <pre>public XmlTool(<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a> node)</pre> |
| <div class="block">Builds an XmlTool around a node.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>node</code> - target node</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="XmlTool-java.util.List-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>XmlTool</h4> |
| <pre>public XmlTool(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>> nodes)</pre> |
| <div class="block">Builds an XmlTool around a nodes list.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>nodes</code> - nodes list</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="initializeImportSupport-org.apache.velocity.tools.generic.ValueParser-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>initializeImportSupport</h4> |
| <pre>protected void initializeImportSupport(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a> config)</pre> |
| <div class="block">ImportSupport initialization</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>config</code> - configuration values</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="configure-org.apache.velocity.tools.generic.ValueParser-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>configure</h4> |
| <pre>protected void configure(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a> values)</pre> |
| <div class="block">Configuration.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></code> in class <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>values</code> - configuration values</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setRoot-org.w3c.dom.Node-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setRoot</h4> |
| <pre>protected void setRoot(<a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a> node)</pre> |
| <div class="block">Sets a singular root <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> for this instance.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>node</code> - new root node</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="parse-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parse</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> parse(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> xml)</pre> |
| <div class="block">Parses the given XML string and uses the resulting <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom"><code>Document</code></a> |
| as the root <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>xml</code> - XML string</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>new XmlTool</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="read-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>read</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> read(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resource)</pre> |
| <div class="block">Reads and parses a local resource file</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>resource</code> - resource path</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>new XmlTool</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="fetch-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fetch</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> fetch(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> url)</pre> |
| <div class="block">Reads and parses a remote or local URL</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>url</code> - resource URL</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>new XmlTool</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="get-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> get(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</pre> |
| <div class="block">This will first attempt to find an attribute with the |
| specified name and return its value. If no such attribute |
| exists or its value is <code>null</code>, this will attempt to convert |
| the given value to a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> and get the result of |
| <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get-java.lang.Number-"><code>get(Number)</code></a>. If the number conversion fails, |
| then this will convert the object to a string. If that string |
| does not contain a '/', it appends the result of <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getPath--"><code>getPath()</code></a> |
| and a '/' to the front of it. Finally, it delegates the string to the |
| <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find-java.lang.String-"><code>find(String)</code></a> method and returns the result of that.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>o</code> - attribute name, number, xpath relative expression</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>found value or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getName--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getName</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> getName()</pre> |
| <div class="block">Asks <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get-java.lang.Object-"><code>get(Object)</code></a> for a "name" result. |
| If none, this will return the result of <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getNodeName--"><code>getNodeName()</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>found value or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getNodeName--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNodeName</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getNodeName()</pre> |
| <div class="block">Returns the name of the root node. If the internal <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> |
| list has more than one <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>, it will only return the name |
| of the first node in the list.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>node name</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getPath--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPath</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getPath()</pre> |
| <div class="block">Returns the XPath that identifies the first/sole <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> |
| represented by this instance.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>xpath node path</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="attr-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>attr</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> attr(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</pre> |
| <div class="block">Returns the value of the specified attribute for the first/sole |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> in the internal Node list for this instance, if that |
| Node is an <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>. If it is a non-Element node type or |
| there is no value for that attribute in this element, then this |
| will return <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>o</code> - attribute name</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>attribute value or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="attributes--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>attributes</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> attributes()</pre> |
| <div class="block">Returns a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util"><code>Map</code></a> of all attributes for the first/sole |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> held internally by this instance. If that Node is |
| not an <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>, this will return null.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>attributes map</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isEmpty--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre>public boolean isEmpty()</pre> |
| <div class="block">Returns <code>true</code> if there are no <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s internally held |
| by this instance.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>whether the set of current nodes is empty</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="size--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>size</h4> |
| <pre>public int size()</pre> |
| <div class="block">Returns the number of <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s internally held by this instance.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the size of the set of current nodes</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="iterator--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>iterator</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a>> iterator()</pre> |
| <div class="block">Returns an <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util"><code>Iterator</code></a> that returns new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> |
| instances for each <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> held internally by this instance.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an iterator on wrappers of current nodes or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getFirst--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getFirst</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> getFirst()</pre> |
| <div class="block">Returns an <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> that wraps only the |
| first <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this instance's internal Node list.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on the first node or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getLast--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLast</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> getLast()</pre> |
| <div class="block">Returns an <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> that wraps only the |
| last <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this instance's internal Node list.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on the last node or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="get-java.lang.Number-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> get(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a> n)</pre> |
| <div class="block">Returns an <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> that wraps the specified |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this instance's internal Node list.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>n</code> - node index in current nodes list</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on the nth node or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="node--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>node</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a> node()</pre> |
| <div class="block">Returns the first/sole <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> from this |
| instance's internal Node list, if any.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the unwrapped first node or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="find-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>find</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> find(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</pre> |
| <div class="block">Converts the specified object to a String and calls |
| <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find-java.lang.String-"><code>find(String)</code></a> with that.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>o</code> - xpath to search</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on found nodes or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="find-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>find</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> find(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> xpath)</pre> |
| <div class="block">Performs an XPath selection on the current set of |
| <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s held by this instance and returns a new |
| <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps those results. |
| If the specified value is null or this instance does |
| not currently hold any nodes, then this will return |
| <code>null</code>. If the specified value, when converted |
| to a string, does not contain a '/' character, then |
| it has "//" prepended to it. This means that a call to |
| <code>$xml.find("a")</code> is equivalent to calling |
| <code>$xml.find("//a")</code>. The full range of XPath |
| selectors is supported here.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>xpath</code> - xpath to search</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on found nodes or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getParent--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getParent</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> getParent()</pre> |
| <div class="block">Returns a new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps |
| the parent <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a> of the first/sole <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a> |
| being wrapped by this instance.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>wrapper on the parent of the first node or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="parents--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parents</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> parents()</pre> |
| <div class="block">Returns a new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps |
| the parent <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>s of each of the <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s |
| being wrapped by this instance. This does not return |
| all ancestors, just the immediate parents.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on the set of parents nodes or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="children--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>children</h4> |
| <pre>public <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</a> children()</pre> |
| <div class="block">Returns a new <a href="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><code>XmlTool</code></a> instance that wraps all the |
| child <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>s of all the current internally held nodes |
| that are <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html?is-external=true" title="class or interface in org.w3c.dom"><code>Element</code></a>s themselves.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a wrapper on the children of current nodes</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getText--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getText</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getText()</pre> |
| <div class="block">Returns the concatenated text content of all the internally held |
| nodes. Obviously, this is most useful when only one node is held.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>text of current nodes or null</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="toString--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString()</pre> |
| <div class="block">If this instance has no XML <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom"><code>Node</code></a>s, then this |
| returns the result of <code>super.toString()</code>. Otherwise, it |
| returns the XML (as a string) of all the internally held nodes |
| that are not <a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Attr.html?is-external=true" title="class or interface in org.w3c.dom"><code>Attr</code></a>ibutes. For attributes, only the value |
| is used.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>XML string of current nodes or null</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/XmlTool.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/velocity/tools/generic/XmlTool.html" target="_top">Frames</a></li> |
| <li><a href="XmlTool.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2002–2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |