| <!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_281) on Sun Jan 15 15:58:35 CET 2023 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>NodeListModel (FreeMarker 2.3.32 API)</title> |
| <meta name="date" content="2023-01-15"> |
| <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="NodeListModel (FreeMarker 2.3.32 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":42,"i1":42,"i2":42,"i3":42,"i4":42,"i5":42,"i6":41,"i7":42,"i8":42}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/NodeListModel.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>Prev Class</li> |
| <li>Next Class</li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../index.html?freemarker/ext/jdom/NodeListModel.html" target="_top">Frames</a></li> |
| <li><a href="NodeListModel.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>Nested | </li> |
| <li>Field | </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>Field | </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">freemarker.ext.jdom</div> |
| <h2 title="Class NodeListModel" class="title">Class NodeListModel</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>freemarker.ext.jdom.NodeListModel</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="../../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template">TemplateCollectionModel</a>, <a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a>, <a href="../../../freemarker/template/TemplateMethodModel.html" title="interface in freemarker.template">TemplateMethodModel</a>, <a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a>, <a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a>, <a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></dd> |
| </dl> |
| <hr> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Use <a href="../../../freemarker/ext/dom/NodeModel.html" title="class in freemarker.ext.dom"><code>NodeModel</code></a> instead.</span></div> |
| </div> |
| <br> |
| <pre>@Deprecated |
| public class <span class="typeNameLabel">NodeListModel</span> |
| extends java.lang.Object |
| implements <a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a>, <a href="../../../freemarker/template/TemplateMethodModel.html" title="interface in freemarker.template">TemplateMethodModel</a>, <a href="../../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template">TemplateCollectionModel</a>, <a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a>, <a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a></pre> |
| <div class="block">Provides a template for wrapping JDOM objects. It is capable of storing not only |
| a single JDOM node, but a list of JDOM nodes at once (hence the name). |
| Each node is an instance of any of the core JDOM node classes (except namespaces, |
| which are not supported at the moment), or String for representing text. |
| See individual method documentation for exact details on how the class works. In |
| short: |
| <ul> |
| <li><a href="../../../freemarker/ext/jdom/NodeListModel.html#getAsString--"><code>getAsString()</code></a> will render all contained nodes as XML fragment, |
| <li><a href="../../../freemarker/ext/jdom/NodeListModel.html#exec-java.util.List-"><code>exec(List)</code></a> provides full XPath functionality implemented on top of |
| the <a href="http://www.jaxen.org">Jaxen</a> library,</li> |
| <li><a href="../../../freemarker/ext/jdom/NodeListModel.html#get-java.lang.String-"><code>get(String)</code></a> provides node traversal, copying and filtering - somewhat |
| less expressive than XPath, however it does not require the external library and |
| it evaluates somewhat faster</li> |
| <li>being a <a href="../../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template"><code>TemplateCollectionModel</code></a> allows to iterate the contained node list, and</li> |
| <li>being a <a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template"><code>TemplateSequenceModel</code></a> allows to access the contained nodes by index and query the node count.</li> |
| </ul> |
| |
| <p><b>Note:</b> There is a JDOM independent re-implementation of this class: |
| <a href="../../../freemarker/ext/xml/NodeListModel.html" title="class in freemarker.ext.xml"><code>freemarker.ext.xml.NodeListModel</code></a></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.freemarker.template.TemplateScalarModel"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from interface freemarker.template.<a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a></h3> |
| <code><a href="../../../freemarker/template/TemplateScalarModel.html#EMPTY_STRING">EMPTY_STRING</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.freemarker.template.TemplateModel"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from interface freemarker.template.<a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></h3> |
| <code><a href="../../../freemarker/template/TemplateModel.html#NOTHING">NOTHING</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="../../../freemarker/ext/jdom/NodeListModel.html#NodeListModel-org.jdom.Document-">NodeListModel</a></span>(org.jdom.Document document)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a single <code>Document</code> node.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#NodeListModel-org.jdom.Element-">NodeListModel</a></span>(org.jdom.Element element)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a single <code>Element</code> node.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#NodeListModel-java.util.List-">NodeListModel</a></span>(java.util.List nodes)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a list of nodes.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#NodeListModel-java.util.List-boolean-">NodeListModel</a></span>(java.util.List nodes, |
| boolean copy)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a list of nodes.</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated 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>java.lang.Object</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#exec-java.util.List-">exec</a></span>(java.util.List arguments)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Applies an XPath expression to the node list and returns the resulting node list.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#get-int-">get</a></span>(int i)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Retrieves the i-th element of the node list.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#get-java.lang.String-">get</a></span>(java.lang.String key)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Provides node list traversal as well as special functions: filtering by name, |
| filtering by node type, shallow-copying, and duplicate removal.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#getAsString--">getAsString</a></span>()</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">This method returns the string resulting from concatenation |
| of string representations of its nodes.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#isEmpty--">isEmpty</a></span>()</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Returns true if this model contains no nodes.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../freemarker/template/TemplateModelIterator.html" title="interface in freemarker.template">TemplateModelIterator</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#iterator--">iterator</a></span>()</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Retrieves a template model iterator that is used to iterate over the elements in this collection.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#main-java.lang.String:A-">main</a></span>(java.lang.String[] args)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").</span></div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#registerNamespace-java.lang.String-java.lang.String-">registerNamespace</a></span>(java.lang.String prefix, |
| java.lang.String uri)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Registers an XML namespace with this node list.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/jdom/NodeListModel.html#size--">size</a></span>()</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="NodeListModel-org.jdom.Document-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NodeListModel</h4> |
| <pre>public NodeListModel(org.jdom.Document document)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a single <code>Document</code> node.</div> |
| </li> |
| </ul> |
| <a name="NodeListModel-org.jdom.Element-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NodeListModel</h4> |
| <pre>public NodeListModel(org.jdom.Element element)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a single <code>Element</code> node.</div> |
| </li> |
| </ul> |
| <a name="NodeListModel-java.util.List-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NodeListModel</h4> |
| <pre>public NodeListModel(java.util.List nodes)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a list of nodes.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>nodes</code> - the list of nodes this template should hold. The created template |
| will copy the passed nodes list, so changes to the passed list will not affect |
| the model.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="NodeListModel-java.util.List-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>NodeListModel</h4> |
| <pre>public NodeListModel(java.util.List nodes, |
| boolean copy)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Creates a node list that holds a list of nodes.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>nodes</code> - the list of nodes this template should hold.</dd> |
| <dd><code>copy</code> - if true, the created template will copy the passed nodes list, |
| so changes to the passed list will not affect the model. If false, the model |
| will reference the passed list and will sense changes in it, although no |
| operations on the list will be synchronized.</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="isEmpty--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre>public boolean isEmpty()</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Returns true if this model contains no nodes.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateHashModel.html#isEmpty--">isEmpty</a></code> in interface <code><a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getAsString--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAsString</h4> |
| <pre>public java.lang.String getAsString() |
| throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">This method returns the string resulting from concatenation |
| of string representations of its nodes. Each node is rendered using its XML |
| serialization format, while text (String) is rendered as itself. This greatly |
| simplifies creating XML-transformation templates, as to output a node contained |
| in variable x as XML fragment, you simply write ${x} in the template.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateScalarModel.html#getAsString--">getAsString</a></code> in interface <code><a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a></code></dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="get-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre>public <a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a> get(java.lang.String key) |
| throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Provides node list traversal as well as special functions: filtering by name, |
| filtering by node type, shallow-copying, and duplicate removal. |
| While not as powerful as the full XPath support built into the |
| <a href="../../../freemarker/ext/jdom/NodeListModel.html#exec-java.util.List-"><code>exec(List)</code></a> method, it does not require the external Jaxen |
| library to be present at run time. Below are listed the recognized keys. |
| In key descriptions, "applicable to this-and-that node type" means that if |
| a key is applied to a node list that contains a node of non-applicable type |
| a TemplateMethodModel will be thrown. However, you can use <tt>_ftype</tt> |
| key to explicitly filter out undesired node types prior to applying the |
| restricted-applicability key. Also "current nodes" means nodes contained in this |
| set. |
| <ul> |
| <li><tt>*</tt> or <tt>_children</tt>: all direct element children of current nodes (non-recursive). Applicable |
| to element and document nodes.</li> |
| <li><tt>@*</tt> or <tt>_attributes</tt>: all attributes of current nodes. Applicable to elements only.</li> |
| <li><tt>_content</tt> the complete content of current nodes (non-recursive). |
| Applicable to elements and documents.</li> |
| <li><tt>_text</tt>: the text of current nodes, one string per node (non-recursive). |
| Applicable to elements, attributes, comments, processing instructions (returns its data) |
| and CDATA sections. The reserved XML characters ('<' and '&') are escaped.</li> |
| <li><tt>_plaintext</tt>: same as <tt>_text</tt>, but does not escape any characters, |
| and instead of returning a NodeList returns a SimpleScalar.</li> |
| <li><tt>_name</tt>: the names of current nodes, one string per node (non-recursive). |
| Applicable to elements and attributes (returns their local name), |
| entities, processing instructions (returns its target), doctypes |
| (returns its public ID)</li> |
| <li><tt>_qname</tt>: the qualified names of current nodes in <tt>[namespacePrefix:]localName</tt> |
| form, one string per node (non-recursive). Applicable to elements and attributes</li> |
| <li><tt>_cname</tt>: the canonical names of current nodes (namespace URI + local name), |
| one string per node (non-recursive). Applicable to elements and attributes</li> |
| <li><tt>_nsprefix</tt>: namespace prefixes of current nodes, |
| one string per node (non-recursive). Applicable to elements and attributes</li> |
| <li><tt>_nsuri</tt>: namespace URIs of current nodes, |
| one string per node (non-recursive). Applicable to elements and attributes</li> |
| <li><tt>_parent</tt>: parent elements of current nodes. Applicable to element, attribute, comment, |
| entity, processing instruction.</li> |
| <li><tt>_ancestor</tt>: all ancestors up to root element (recursive) of current nodes. Applicable |
| to same node types as <tt>_parent</tt>.</li> |
| <li><tt>_ancestorOrSelf</tt>: all ancestors of current nodes plus current nodes. Applicable |
| to same node types as <tt>_parent</tt>.</li> |
| <li><tt>_descendant</tt>: all recursive descendant element children of current nodes. Applicable to |
| document and element nodes. |
| <li><tt>_descendantOrSelf</tt>: all recursive descendant element children of current nodes |
| plus current nodes. Applicable to document and element nodes. |
| <li><tt>_document</tt>: all documents the current nodes belong to. |
| Applicable to all nodes except text. |
| <li><tt>_doctype</tt>: doctypes of the current nodes. |
| Applicable to document nodes only. |
| <li><tt>_fname</tt>: is a filter-by-name template method model. When called, |
| it will yield a node list that contains only those current nodes whose name |
| matches one of names passed as argument. Attribute names should NOT be prefixed with the |
| at sign (@). Applicable on all node types, however has no effect on unnamed nodes.</li> |
| <li><tt>_ftype</tt>: is a filter-by-type template method model. When called, |
| it will yield a node list that contains only those current nodes whose type matches one |
| of types passed as argument. You should pass a single string to this method |
| containing the characters of all types to keep. Valid characters are: |
| e (Element), a (Attribute), n (Entity), d (Document), t (DocType), |
| c (Comment), p (ProcessingInstruction), x (text). If the string anywhere contains |
| the exclamation mark (!), the filter's effect is inverted.</li> |
| <li><tt>_type</tt>: Returns a one-character String SimpleScalar containing |
| the typecode of the first node in the node list. Valid characters are: |
| e (Element), a (Attribute), n (Entity), d (Document), t (DocType), |
| c (Comment), p (ProcessingInstruction), x (text). If the type of the node |
| is unknown, returns '?'. If the node list is empty, returns an empty string scalar.</li> |
| <li><tt>_unique</tt>: a copy of the current nodes that keeps only the |
| first occurrence of every node, eliminating duplicates. Duplicates can |
| occur in the node list by applying uptree-traversals <tt>_parent</tt>, |
| <tt>_ancestor</tt>, <tt>_ancestorOrSelf</tt>, and <tt>_document</tt>. |
| I.e. <tt>foo._children._parent</tt> will return a node list that has |
| duplicates of nodes in foo - each node will have the number of occurrences |
| equal to the number of its children. In these cases, use |
| <tt>foo._children._parent._unique</tt> to eliminate duplicates. Applicable |
| to all node types.</li> |
| <li><tt>_copy</tt>: a copy of the current node list. It is a shallow copy that |
| shares the underlying node list with this node list, however it has a |
| separate namespace registry, so it can be used to guarantee that subsequent |
| changes to the set of registered namespaces does not affect the node lists |
| that were used to create this node list. Applicable to all node types.</li> |
| <li><tt>_registerNamespace(prefix, uri)</tt>: register a XML namespace |
| with the specified prefix and URI for the current node list and all node |
| lists that are derived from the current node list. After registering, |
| you can use the <tt>nodelist["prefix:localname"]</tt> or |
| <tt>nodelist["@prefix:localname"]</tt> syntaxes to reach elements and |
| attributes whose names are namespace-scoped. Note that the namespace |
| prefix need not match the actual prefix used by the XML document itself |
| since namespaces are compared solely by their URI. You can also register |
| namespaces from Java code using the |
| <a href="../../../freemarker/ext/jdom/NodeListModel.html#registerNamespace-java.lang.String-java.lang.String-"><code>registerNamespace(String, String)</code></a> method. |
| </li> |
| <li><tt>@attributeName</tt>: named attributes of current nodes. Applicable to |
| elements, doctypes and processing instructions. On doctypes it supports |
| attributes <tt>publicId</tt>, <tt>systemId</tt> and <tt>elementName</tt>. On processing |
| instructions, it supports attributes <tt>target</tt> and <tt>data</tt>, as |
| well as any other attribute name specified in data as <tt>name="value"</tt> pair. |
| The attribute nodes for doctype and processing instruction are synthetic, and |
| as such have no parent. Note, however that <tt>@*</tt> does NOT operate on |
| doctypes or processing instructions.</li> |
| <li>any other key: element children of current nodes with name matching the key. |
| This allows for convenience child traversal in <tt>book.chapter.title</tt> style syntax. |
| Note that <tt>nodeset.childname</tt> is technically equivalent to |
| <tt>nodeset._children._fname("childname")</tt>, but is both shorter to write |
| and evaluates faster. Applicable to document and element nodes.</li> |
| </ul> |
| The order of nodes in the resulting set is the order of evaluation of the key |
| on each node in this set from left to right. Evaluation of the key on a single |
| node always yields the results in "natural" order (that of the document preorder |
| traversal), even for uptree traversals. As a consequence, if this node list's nodes |
| are listed in natural order, applying any of the keys will produce a node list that |
| is also naturally ordered. As a special case, all node lists that are directly or |
| indirectly generated from a single Document or Element node through repeated |
| invocations of this method will be naturally ordered.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateHashModel.html#get-java.lang.String-">get</a></code> in interface <code><a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>key</code> - a key that identifies a required set of nodes</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new NodeListModel that represents the requested set of nodes.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="iterator--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>iterator</h4> |
| <pre>public <a href="../../../freemarker/template/TemplateModelIterator.html" title="interface in freemarker.template">TemplateModelIterator</a> iterator()</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../freemarker/template/TemplateCollectionModel.html#iterator--">TemplateCollectionModel</a></code></span></div> |
| <div class="block">Retrieves a template model iterator that is used to iterate over the elements in this collection.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateCollectionModel.html#iterator--">iterator</a></code> in interface <code><a href="../../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template">TemplateCollectionModel</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="get-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre>public <a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a> get(int i) |
| throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Retrieves the i-th element of the node list.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateSequenceModel.html#get-int-">get</a></code> in interface <code><a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the item at the specified index, or <code>null</code> if the index is out of bounds. Note that a |
| <code>null</code> value is interpreted by FreeMarker as "variable does not exist", and accessing a |
| missing variables is usually considered as an error in the FreeMarker Template Language, so the usage of |
| a bad index will not remain hidden, unless the default value for that case was also specified in the |
| template.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></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"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateSequenceModel.html#size--">size</a></code> in interface <code><a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of items in the list.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="exec-java.util.List-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>exec</h4> |
| <pre>public java.lang.Object exec(java.util.List arguments) |
| throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Applies an XPath expression to the node list and returns the resulting node list. |
| In order for this method to work, your application must have access |
| <a href="http://www.jaxen.org">Jaxen</a> library classes. The |
| implementation does cache the parsed format of XPath expressions in a weak hash |
| map, keyed by the string representation of the XPath expression. As the string |
| object passed as the argument is usually kept in the parsed FreeMarker template, |
| this ensures that each XPath expression is parsed only once during the lifetime |
| of the FreeMarker template that contains it.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateMethodModel.html#exec-java.util.List-">exec</a></code> in interface <code><a href="../../../freemarker/template/TemplateMethodModel.html" title="interface in freemarker.template">TemplateMethodModel</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>arguments</code> - the list of arguments. Must contain exactly one string that is |
| the XPath expression you wish to apply. The XPath expression can use any namespace |
| prefixes that were defined using the <a href="../../../freemarker/ext/jdom/NodeListModel.html#registerNamespace-java.lang.String-java.lang.String-"><code>registerNamespace(String, String)</code></a> |
| method or the <code>nodelist._registerNamespace(prefix, uri)</code> expression in the |
| template.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a NodeListModel representing the nodes that are the result of application |
| of the XPath to the current node list.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="registerNamespace-java.lang.String-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>registerNamespace</h4> |
| <pre>public void registerNamespace(java.lang.String prefix, |
| java.lang.String uri)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <div class="block">Registers an XML namespace with this node list. Once registered, you can |
| refer to the registered namespace using its prefix in the |
| <a href="../../../freemarker/ext/jdom/NodeListModel.html#get-java.lang.String-"><code>get(String)</code></a> method from this node list and all other |
| node lists that are derived from this node list. Use the |
| <tt>nodelist["prefix:localname"]</tt> or the |
| <tt>nodelist["@prefix:localname"]</tt> syntax to reach elements and |
| attributes whose names are namespace-scoped. Note that the namespace |
| prefix need not match the actual prefix used by the XML document itself |
| since namespaces are compared solely by their URI. You can also register |
| namespaces during template evaluation using the |
| <tt>nodelist._registerNamespace(prefix, uri)</tt> syntax in the template. |
| This mechanism is completely independent from the namespace declarations |
| in the XML document itself; its purpose is to give you an easy way |
| to refer to namespace-scoped elements in <a href="../../../freemarker/ext/jdom/NodeListModel.html#get-java.lang.String-"><code>get(String)</code></a> and |
| in XPath expressions passed to <a href="../../../freemarker/ext/jdom/NodeListModel.html#exec-java.util.List-"><code>exec(List)</code></a>. Note also that |
| the namespace prefix registry is shared among all node lists that |
| are created from a single node list - modifying the registry in one |
| affects all others as well. If you want to obtain a namespace |
| "detached" copy of the node list, use the <code>_copy</code> key on |
| it (or call <code>nodeList.get("_copy")</code> directly from your |
| Java code. The returned node list has all the namespaces that the |
| original node list has, but they can be manipulated independently |
| thereon.</div> |
| </li> |
| </ul> |
| <a name="main-java.lang.String:A-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>main</h4> |
| <pre>@Deprecated |
| public static void main(java.lang.String[] args) |
| throws java.lang.Exception</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").</span></div> |
| <div class="block">Loads a template from a file passed as the first argument, loads an XML |
| document from the standard input, passes it to the template as variable |
| <tt>document</tt> and writes the result of template processing to |
| standard output.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.Exception</code></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/NodeListModel.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>Prev Class</li> |
| <li>Next Class</li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../index.html?freemarker/ext/jdom/NodeListModel.html" target="_top">Frames</a></li> |
| <li><a href="NodeListModel.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>Nested | </li> |
| <li>Field | </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>Field | </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 ======= --> |
| </body> |
| </html> |