| Home >> All >> org >> apache >> velocity >> [ anakia Javadoc ] |
org.apache.velocity.anakia: Javadoc index of package org.apache.velocity.anakia.
Package Samples:
org.apache.velocity.anakia
Classes:
XPathTool: This class adds an entrypoint into XPath functionality, for Anakia. All methods take a string XPath specification, along with a context, and produces a resulting java.util.List. The W3C XPath Specification (http://www.w3.org/TR/xpath) refers to NodeSets repeatedly, but this implementation simply uses java.util.List to hold all Nodes. A 'Node' is any object in a JDOM object tree, such as an org.jdom.Element, org.jdom.Document, or org.jdom.Attribute. To use it in Velocity, do this: #set $authors = $xpath.applyTo("document/author", $root) #foreach ($author in $authors) $author.getValue() #end #set ...
NodeList: Provides a class for wrapping a list of JDOM objects primarily for use in template engines and other kinds of text transformation tools. It has a toString() 55 method that will output the XML serialized form of the nodes it contains - again focusing on template engine usage, as well as the selectNodes(String) 55 method that helps selecting a different set of nodes starting from the nodes in this list. The class also implements the java.util.List interface by simply delegating calls to the contained list (the subList(int, int) 55 method is implemented by delegating to the contained list and wrapping ...
AnakiaElement: A JDOM org.jdom.Element that is tailored for Anakia needs. It has selectNodes(String) 55 method as well as a toString() 55 that outputs the XML serialized form of the element. This way it acts in much the same way as a single-element NodeList would.
TreeWalker: This class allows you to walk a tree of JDOM Element objects. It first walks the tree itself starting at the Element passed into allElements() and stores each node of the tree in a Vector which allElements() returns as a result of its execution. You can then use a #foreach in Velocity to walk over the Vector and visit each Element node. However, you can achieve the same effect by calling element.selectNodes("//*") .
AnakiaTask: The purpose of this Ant Task is to allow you to use Velocity as an XML transformation tool like XSLT is. So, instead of using XSLT, you will be able to use this class instead to do your transformations. It works very similar in concept to Ant's <style> task. You can find more documentation about this class on the Velocity Website .
XPathCache: Provides a cache for XPath expressions. Used by NodeList and AnakiaElement to minimize XPath parsing in their selectNodes() methods.
AnakiaJDOMFactory: A customized JDOMFactory for Anakia that produces AnakiaElement instances instead of ordinary JDOM org.jdom.Element instances.
Escape: This class is for escaping CDATA sections. The code was "borrowed" from the JDOM code. I also added in escaping of the " -> &quot; character.
OutputWrapper: This class extends XMLOutputter in order to provide a way to walk an Element tree into a String.
| Home | Contact Us | Privacy Policy | Terms of Service |