Java Doc for AnakiaElement.java in  » Template-Engine » Velocity » org » apache » velocity » anakia » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Template Engine » Velocity » org.apache.velocity.anakia 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.velocity.anakia.AnakiaElement

AnakiaElement
public class AnakiaElement extends Element (Code)
A JDOM Element that is tailored for Anakia needs. It has AnakiaElement.selectNodes(String) method as well as a AnakiaElement.toString() that outputs the XML serialized form of the element. This way it acts in much the same way as a single-element NodeList would.
author:
   Attila Szegedi
version:
   $Id: AnakiaElement.java 463298 2006-10-12 16:10:32Z henning $



Constructor Summary
public  AnakiaElement(String name, Namespace namespace)
    

This will create a new AnakiaElement with the supplied (local) name, and define the Namespace to be used.

public  AnakiaElement(String name)
    

This will create an AnakiaElement in no Namespace .

public  AnakiaElement(String name, String uri)
    

This will create a new AnakiaElement with the supplied (local) name, and specifies the URI of the Namespace the Element should be in, resulting it being unprefixed (in the default namespace).

public  AnakiaElement(String name, String prefix, String uri)
    

This will create a new AnakiaElement with the supplied (local) name, and specifies the prefix and URI of the Namespace the Element should be in.


Method Summary
public  ListgetAttributes()
    

This returns the complete set of attributes for this element, as a NodeList of Attribute objects in no particular order, or an empty list if there are none.

public  ListgetChildren()
    

This returns a NodeList of all the child elements nested directly (one level deep) within this element, as Element objects.

public  ListgetChildren(String name)
    

This returns a NodeList of all the child elements nested directly (one level deep) within this element with the given local name and belonging to no namespace, returned as Element objects.

public  ListgetChildren(String name, Namespace ns)
    

This returns a NodeList of all the child elements nested directly (one level deep) within this element with the given local name and belonging to the given Namespace, returned as Element objects.

public  ListgetContent()
    

This returns the full content of the element as a NodeList which may contain objects of type String, Element, Comment, ProcessingInstruction, CDATA, and EntityRef. The List returned is "live" in document order and modifications to it affect the element's actual contents.

public  NodeListselectNodes(String xpathExpression)
     Applies an XPath expression to this element and returns the resulting node list.
public  StringtoString()
     Returns the XML serialized form of this element, as produced by the default XMLOutputter .


Constructor Detail
AnakiaElement
public AnakiaElement(String name, Namespace namespace)(Code)

This will create a new AnakiaElement with the supplied (local) name, and define the Namespace to be used. If the provided namespace is null, the element will have no namespace.


Parameters:
  name - String name of element.
Parameters:
  namespace - Namespace to put element in.



AnakiaElement
public AnakiaElement(String name)(Code)

This will create an AnakiaElement in no Namespace .


Parameters:
  name - String name of element.



AnakiaElement
public AnakiaElement(String name, String uri)(Code)

This will create a new AnakiaElement with the supplied (local) name, and specifies the URI of the Namespace the Element should be in, resulting it being unprefixed (in the default namespace).


Parameters:
  name - String name of element.
Parameters:
  uri - String URI for Namespace elementshould be in.



AnakiaElement
public AnakiaElement(String name, String prefix, String uri)(Code)

This will create a new AnakiaElement with the supplied (local) name, and specifies the prefix and URI of the Namespace the Element should be in.


Parameters:
  name - String name of element.
Parameters:
  prefix - The prefix of the element.
Parameters:
  uri - String URI for Namespace elementshould be in.




Method Detail
getAttributes
public List getAttributes()(Code)

This returns the complete set of attributes for this element, as a NodeList of Attribute objects in no particular order, or an empty list if there are none. The returned list is "live" and changes to it affect the element's actual attributes.

attributes for the element



getChildren
public List getChildren()(Code)

This returns a NodeList of all the child elements nested directly (one level deep) within this element, as Element objects. If this target element has no nested elements, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents.

This performs no recursion, so elements nested two levels deep would have to be obtained with:

 
 Iterator itr = currentElement.getChildren().iterator();
 while (itr.hasNext()) {
 Element oneLevelDeep = (Element)nestedElements.next();
 List twoLevelsDeep = oneLevelDeep.getChildren();
 // Do something with these children
 }
 
 

list of child Element objects for this element



getChildren
public List getChildren(String name)(Code)

This returns a NodeList of all the child elements nested directly (one level deep) within this element with the given local name and belonging to no namespace, returned as Element objects. If this target element has no nested elements with the given name outside a namespace, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents.

Please see the notes for AnakiaElement.getChildren() for a code example.


Parameters:
  name - local name for the children to match all matching child elements



getChildren
public List getChildren(String name, Namespace ns)(Code)

This returns a NodeList of all the child elements nested directly (one level deep) within this element with the given local name and belonging to the given Namespace, returned as Element objects. If this target element has no nested elements with the given name in the given Namespace, an empty List is returned. The returned list is "live" in document order and changes to it affect the element's actual contents.

Please see the notes for AnakiaElement.getChildren() for a code example.


Parameters:
  name - local name for the children to match
Parameters:
  ns - Namespace to search within all matching child elements



getContent
public List getContent()(Code)

This returns the full content of the element as a NodeList which may contain objects of type String, Element, Comment, ProcessingInstruction, CDATA, and EntityRef. The List returned is "live" in document order and modifications to it affect the element's actual contents. Whitespace content is returned in its entirety.

a List containing the mixed content of theelement: may contain String,Element, org.jdom.Comment,org.jdom.ProcessingInstruction,org.jdom.CDATA, andorg.jdom.EntityRef objects.



selectNodes
public NodeList selectNodes(String xpathExpression)(Code)
Applies an XPath expression to this element and returns the resulting node list. In order for this method to work, your application must have access to werken.xpath 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 template, this ensures that each XPath expression is parsed only once during the lifetime of the template that first invoked it.
Parameters:
  xpathExpression - the XPath expression you wish to apply a NodeList representing the nodes that are the result ofapplication of the XPath to the current element. It can be empty.



toString
public String toString()(Code)
Returns the XML serialized form of this element, as produced by the default XMLOutputter . The XML serialized form of this element, as produced by the defaultXMLOutputter.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.