Java Doc for NamespaceHelper.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » lenya » xml » 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 » Content Management System » apache lenya 2.0 » org.apache.lenya.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.lenya.xml.NamespaceHelper

NamespaceHelper
public class NamespaceHelper (Code)
A NamespaceHelper object simplifies the creation of elements in a certain namespace. All elements are owned by a document that is passed to the NamespaceHelper.NamespaceHelper(String,String,Document) constructor or created using the NamespaceHelper.NamespaceHelper(String,String,String) constructor.



Constructor Summary
public  NamespaceHelper(String _namespaceUri, String _prefix, Document _document)
     Creates a new instance of NamespaceHelper using an existing document.
public  NamespaceHelper(String _namespaceUri, String _prefix, String localName)
    

Creates a new instance of NamespaceHelper.


Method Summary
public  ElementcreateElement(String localName)
    

Creates an element within the namespace of this NamespaceHelper object with a given local name containing a text node.

createElement("text"): <prefix:text/>.


Parameters:
  localName - The local name of the element.
public  ElementcreateElement(String localName, String text)
    

Creates an element within the namespace of this NamespaceHelper object with a given local name containing a text node.

createElement("text", "Hello World!"): <prefix:text>Hello World!</prefix:text>.


Parameters:
  localName - The local name of the element.
Parameters:
  text - The text for the text node inside the element.
public  Element[]getChildren(Element element)
     Returns all children of an element in the namespace of this NamespaceHelper.
Parameters:
  element - The parent element.
public  Element[]getChildren(Element element, String localName)
     Returns all children of an element with a local name in the namespace of this NamespaceHelper.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return.
public  DocumentgetDocument()
     Returns the document that is used to create elements.
public  ElementgetFirstChild(Element element, String localName)
     Returns the first childr of an element with a local name in the namespace of this NamespaceHelper or null if none exists.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return.
public  StringgetNamespaceURI()
     Returns the namespace URI of this NamespaceHelper.
public  Element[]getNextSiblings(Element element, String localName)
     Returns the next siblings of an element with a local name in the namespace of this NamespaceHelper or null if none exists.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return.
public  Element[]getPrecedingSiblings(Element element, String localName)
     Returns the preceding siblings of an element with a local name in the namespace of this NamespaceHelper or null if none exists.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return.
public  StringgetPrefix()
     Returns the namespace prefix that is used to create elements.
public static  StringgetQualifiedName(String prefix, String localName)
     Returns the qualified name for a local name using the prefix of this NamespaceHelper.
Parameters:
  prefix - The namespace prefix.
Parameters:
  localName - The local name.
public  voidsave(OutputStream stream)
     Saves the XML.


Constructor Detail
NamespaceHelper
public NamespaceHelper(String _namespaceUri, String _prefix, Document _document)(Code)
Creates a new instance of NamespaceHelper using an existing document. The document is not affected. If the prefix is null, the default namespace is used.
Parameters:
  _document - The document.
Parameters:
  _namespaceUri - The namespace URI.
Parameters:
  _prefix - The namespace prefix.



NamespaceHelper
public NamespaceHelper(String _namespaceUri, String _prefix, String localName) throws ParserConfigurationException(Code)

Creates a new instance of NamespaceHelper. A new document is created using a document element in the given namespace with the given prefix. If the prefix is null, the default namespace is used.

NamespaceHelper("http://www.w3.org/2000/svg", "svg", "svg"):
<?xml version="1.0">
<svg:svg xmlns:svg="http://www.w3.org/2000/svg">
</svg:svg>


Parameters:
  localName - The local name of the document element.
Parameters:
  _namespaceUri - The namespace URI.
Parameters:
  _prefix - The namespace prefix.
throws:
  ParserConfigurationException - if an error occured




Method Detail
createElement
public Element createElement(String localName)(Code)

Creates an element within the namespace of this NamespaceHelper object with a given local name containing a text node.

createElement("text"): <prefix:text/>.


Parameters:
  localName - The local name of the element. A new element.



createElement
public Element createElement(String localName, String text)(Code)

Creates an element within the namespace of this NamespaceHelper object with a given local name containing a text node.

createElement("text", "Hello World!"): <prefix:text>Hello World!</prefix:text>.


Parameters:
  localName - The local name of the element.
Parameters:
  text - The text for the text node inside the element. A new element containing a text node.



getChildren
public Element[] getChildren(Element element)(Code)
Returns all children of an element in the namespace of this NamespaceHelper.
Parameters:
  element - The parent element. the children.



getChildren
public Element[] getChildren(Element element, String localName)(Code)
Returns all children of an element with a local name in the namespace of this NamespaceHelper.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return. the children.



getDocument
public Document getDocument()(Code)
Returns the document that is used to create elements. A document object.



getFirstChild
public Element getFirstChild(Element element, String localName)(Code)
Returns the first childr of an element with a local name in the namespace of this NamespaceHelper or null if none exists.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return. the first child.



getNamespaceURI
public String getNamespaceURI()(Code)
Returns the namespace URI of this NamespaceHelper. The namespace URI.



getNextSiblings
public Element[] getNextSiblings(Element element, String localName)(Code)
Returns the next siblings of an element with a local name in the namespace of this NamespaceHelper or null if none exists.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return. the next siblings.



getPrecedingSiblings
public Element[] getPrecedingSiblings(Element element, String localName)(Code)
Returns the preceding siblings of an element with a local name in the namespace of this NamespaceHelper or null if none exists.
Parameters:
  element - The parent element.
Parameters:
  localName - The local name of the children to return. the preceding siblings.



getPrefix
public String getPrefix()(Code)
Returns the namespace prefix that is used to create elements. The namespace prefix.



getQualifiedName
public static String getQualifiedName(String prefix, String localName)(Code)
Returns the qualified name for a local name using the prefix of this NamespaceHelper.
Parameters:
  prefix - The namespace prefix.
Parameters:
  localName - The local name. The qualified name, i.e. prefix:localName.



save
public void save(OutputStream stream)(Code)
Saves the XML.
Parameters:
  stream - The stream to write to.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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