Java Doc for XMLElement.java in  » XML-UI » XUI » net » n3 » nanoxml » 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 » XML UI » XUI » net.n3.nanoxml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.n3.nanoxml.XMLElement

XMLElement
public class XMLElement implements IXMLElement,Serializable(Code)
XMLElement is an XML element. The standard NanoXML builder generates a tree of such elements.
See Also:   net.n3.nanoxml.StdXMLBuilder
author:
   Marc De Scheemaecker
version:
   $Name: $, $Revision: 1.17 $


Field Summary
final public static  intNO_LINE
     No line number defined.
final static  longserialVersionUID
     Necessary for serialization.

Constructor Summary
public  XMLElement()
     Creates an empty element to be used for #PCDATA content.
public  XMLElement(String fullName)
     Creates an empty element.
public  XMLElement(String fullName, String systemID, int lineNr)
     Creates an empty element.
public  XMLElement(String fullName, String namespace)
     Creates an empty element.
public  XMLElement(String fullName, String namespace, String systemID, int lineNr)
     Creates an empty element.

Method Summary
public  voidaddChild(IXMLElement child)
     Adds a child element.
public  IXMLElementcreateElement(String fullName)
     Creates an empty element.
public  IXMLElementcreateElement(String fullName, String systemID, int lineNr)
     Creates an empty element.
public  IXMLElementcreateElement(String fullName, String namespace)
     Creates an empty element.
public  IXMLElementcreateElement(String fullName, String namespace, String systemID, int lineNr)
     Creates an empty element.
public  IXMLElementcreatePCDataElement()
     Creates an element to be used for #PCDATA content.
public  EnumerationenumerateAttributeNames()
     Returns an enumeration of all attribute names.
public  EnumerationenumerateChildren()
     Returns an enumeration of all child elements.
public  booleanequals(Object rawElement)
     Returns true if the element equals another element.
public  booleanequalsXMLElement(IXMLElement elt)
     Returns true if the element equals another element.
protected  voidfinalize()
     Cleans up the object when it's destroyed.
public  StringgetAttribute(String name)
    XMLElement.getAttribute(java.lang.String,java.lang.String)
Parameters:
  name - the non-null name of the attribute.
public  StringgetAttribute(String name, String defaultValue)
     Returns the value of an attribute.
Parameters:
  name - the non-null full name of the attribute.
Parameters:
  defaultValue - the default value of the attribute.
public  StringgetAttribute(String name, String namespace, String defaultValue)
     Returns the value of an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI, which may be null.
Parameters:
  defaultValue - the default value of the attribute.
public  intgetAttribute(String name, int defaultValue)
     Returns the value of an attribute.
Parameters:
  name - the non-null full name of the attribute.
Parameters:
  defaultValue - the default value of the attribute.
public  intgetAttribute(String name, String namespace, int defaultValue)
     Returns the value of an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI, which may be null.
Parameters:
  defaultValue - the default value of the attribute.
public  intgetAttributeCount()
     Returns the number of attributes.
public  StringgetAttributeNamespace(String name)
     Returns the namespace of an attribute.
Parameters:
  name - the non-null full name of the attribute.
public  StringgetAttributeType(String name)
     Returns the type of an attribute.
Parameters:
  name - the non-null full name of the attribute.
public  StringgetAttributeType(String name, String namespace)
     Returns the type of an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI, which may be null.
public  PropertiesgetAttributes()
     Returns all attributes as a Properties object.
public  PropertiesgetAttributesInNamespace(String namespace)
     Returns all attributes in a specific namespace as a Properties object.
Parameters:
  namespace - the namespace URI of the attributes, which may be null.
public  IXMLElementgetChildAtIndex(int index)
     Returns the child at a specific index.
public  VectorgetChildren()
     Returns a vector containing all the child elements.
public  intgetChildrenCount()
     Returns the number of children.
public  VectorgetChildrenNamed(String name)
     Returns a vector of all child elements named name.
Parameters:
  name - the full name of the children to search for.
public  VectorgetChildrenNamed(String name, String namespace)
     Returns a vector of all child elements named name.
Parameters:
  name - the name of the children to search for.
Parameters:
  namespace - the namespace, which may be null.
public  StringgetContent()
     Return the #PCDATA content of the element.
public  IXMLElementgetFirstChildNamed(String name)
     Searches a child element.
Parameters:
  name - the full name of the child to search for.
public  IXMLElementgetFirstChildNamed(String name, String namespace)
     Searches a child element.
Parameters:
  name - the name of the child to search for.
Parameters:
  namespace - the namespace, which may be null.
public  StringgetFullName()
     Returns the full name (i.e.
public  intgetLineNr()
     Returns the line number in the data where the element started.
public  StringgetName()
     Returns the name of the element.
public  StringgetNamespace()
     Returns the namespace of the element.
public  IXMLElementgetParent()
     Returns the parent element.
public  StringgetSystemID()
     Returns the system ID of the data where the element started.
public  booleanhasAttribute(String name)
     Returns whether an attribute exists.
public  booleanhasAttribute(String name, String namespace)
     Returns whether an attribute exists.
public  booleanhasChildren()
     Returns whether the element has children.
public  voidinsertChild(IXMLElement child, int index)
     Inserts a child element.
public  booleanisLeaf()
     Returns whether the element is a leaf element.
public  voidremoveAttribute(String name)
     Removes an attribute.
public  voidremoveAttribute(String name, String namespace)
     Removes an attribute.
public  voidremoveChild(IXMLElement child)
     Removes a child element.
public  voidremoveChildAtIndex(int index)
     Removes the child located at a certain index.
public  voidsetAttribute(String name, String value)
     Sets an attribute.
public  voidsetAttribute(String fullName, String namespace, String value)
     Sets an attribute.
public  voidsetContent(String content)
     Sets the #PCDATA content.
public  voidsetName(String name)
     Sets the full name.
public  voidsetName(String fullName, String namespace)
     Sets the name.

Field Detail
NO_LINE
final public static int NO_LINE(Code)
No line number defined.



serialVersionUID
final static long serialVersionUID(Code)
Necessary for serialization.




Constructor Detail
XMLElement
public XMLElement()(Code)
Creates an empty element to be used for #PCDATA content.



XMLElement
public XMLElement(String fullName)(Code)
Creates an empty element.
Parameters:
  fullName - the name of the element.



XMLElement
public XMLElement(String fullName, String systemID, int lineNr)(Code)
Creates an empty element.
Parameters:
  fullName - the name of the element.
Parameters:
  systemID - the system ID of the XML data where the element starts.
Parameters:
  lineNr - the line in the XML data where the element starts.



XMLElement
public XMLElement(String fullName, String namespace)(Code)
Creates an empty element.
Parameters:
  fullName - the full name of the element
Parameters:
  namespace - the namespace URI.



XMLElement
public XMLElement(String fullName, String namespace, String systemID, int lineNr)(Code)
Creates an empty element.
Parameters:
  fullName - the full name of the element
Parameters:
  namespace - the namespace URI.
Parameters:
  systemID - the system ID of the XML data where the element starts.
Parameters:
  lineNr - the line in the XML data where the element starts.




Method Detail
addChild
public void addChild(IXMLElement child)(Code)
Adds a child element.
Parameters:
  child - the non-null child to add.



createElement
public IXMLElement createElement(String fullName)(Code)
Creates an empty element.
Parameters:
  fullName - the name of the element.



createElement
public IXMLElement createElement(String fullName, String systemID, int lineNr)(Code)
Creates an empty element.
Parameters:
  fullName - the name of the element.
Parameters:
  systemID - the system ID of the XML data where the element starts.
Parameters:
  lineNr - the line in the XML data where the element starts.



createElement
public IXMLElement createElement(String fullName, String namespace)(Code)
Creates an empty element.
Parameters:
  fullName - the full name of the element
Parameters:
  namespace - the namespace URI.



createElement
public IXMLElement createElement(String fullName, String namespace, String systemID, int lineNr)(Code)
Creates an empty element.
Parameters:
  fullName - the full name of the element
Parameters:
  namespace - the namespace URI.
Parameters:
  systemID - the system ID of the XML data where the element starts.
Parameters:
  lineNr - the line in the XML data where the element starts.



createPCDataElement
public IXMLElement createPCDataElement()(Code)
Creates an element to be used for #PCDATA content.



enumerateAttributeNames
public Enumeration enumerateAttributeNames()(Code)
Returns an enumeration of all attribute names. the non-null enumeration.



enumerateChildren
public Enumeration enumerateChildren()(Code)
Returns an enumeration of all child elements. the non-null enumeration



equals
public boolean equals(Object rawElement)(Code)
Returns true if the element equals another element.
Parameters:
  rawElement - the element to compare to



equalsXMLElement
public boolean equalsXMLElement(IXMLElement elt)(Code)
Returns true if the element equals another element.
Parameters:
  rawElement - the element to compare to



finalize
protected void finalize() throws Throwable(Code)
Cleans up the object when it's destroyed.



getAttribute
public String getAttribute(String name)(Code)
XMLElement.getAttribute(java.lang.String,java.lang.String)
Parameters:
  name - the non-null name of the attribute. the value, or null if the attribute does not exist.



getAttribute
public String getAttribute(String name, String defaultValue)(Code)
Returns the value of an attribute.
Parameters:
  name - the non-null full name of the attribute.
Parameters:
  defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist.



getAttribute
public String getAttribute(String name, String namespace, String defaultValue)(Code)
Returns the value of an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI, which may be null.
Parameters:
  defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist.



getAttribute
public int getAttribute(String name, int defaultValue)(Code)
Returns the value of an attribute.
Parameters:
  name - the non-null full name of the attribute.
Parameters:
  defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist.



getAttribute
public int getAttribute(String name, String namespace, int defaultValue)(Code)
Returns the value of an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI, which may be null.
Parameters:
  defaultValue - the default value of the attribute. the value, or defaultValue if the attribute does not exist.



getAttributeCount
public int getAttributeCount()(Code)
Returns the number of attributes.



getAttributeNamespace
public String getAttributeNamespace(String name)(Code)
Returns the namespace of an attribute.
Parameters:
  name - the non-null full name of the attribute. the namespace, or null if there is none associated.



getAttributeType
public String getAttributeType(String name)(Code)
Returns the type of an attribute.
Parameters:
  name - the non-null full name of the attribute. the type, or null if the attribute does not exist.



getAttributeType
public String getAttributeType(String name, String namespace)(Code)
Returns the type of an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI, which may be null. the type, or null if the attribute does not exist.



getAttributes
public Properties getAttributes()(Code)
Returns all attributes as a Properties object. the non-null set.



getAttributesInNamespace
public Properties getAttributesInNamespace(String namespace)(Code)
Returns all attributes in a specific namespace as a Properties object.
Parameters:
  namespace - the namespace URI of the attributes, which may be null. the non-null set.



getChildAtIndex
public IXMLElement getChildAtIndex(int index) throws ArrayIndexOutOfBoundsException(Code)
Returns the child at a specific index.
Parameters:
  index - the index of the child the non-null child
throws:
  java.lang.ArrayIndexOutOfBoundsException - if the index is out of bounds.



getChildren
public Vector getChildren()(Code)
Returns a vector containing all the child elements. the vector.



getChildrenCount
public int getChildrenCount()(Code)
Returns the number of children. the count.



getChildrenNamed
public Vector getChildrenNamed(String name)(Code)
Returns a vector of all child elements named name.
Parameters:
  name - the full name of the children to search for. the non-null vector of child elements.



getChildrenNamed
public Vector getChildrenNamed(String name, String namespace)(Code)
Returns a vector of all child elements named name.
Parameters:
  name - the name of the children to search for.
Parameters:
  namespace - the namespace, which may be null. the non-null vector of child elements.



getContent
public String getContent()(Code)
Return the #PCDATA content of the element. If the element has a combination of #PCDATA content and child elements, the #PCDATA sections can be retrieved as unnamed child objects. In this case, this method returns null. the content.



getFirstChildNamed
public IXMLElement getFirstChildNamed(String name)(Code)
Searches a child element.
Parameters:
  name - the full name of the child to search for. the child element, or null if no such child was found.



getFirstChildNamed
public IXMLElement getFirstChildNamed(String name, String namespace)(Code)
Searches a child element.
Parameters:
  name - the name of the child to search for.
Parameters:
  namespace - the namespace, which may be null. the child element, or null if no such child was found.



getFullName
public String getFullName()(Code)
Returns the full name (i.e. the name including an eventual namespace prefix) of the element. the name, or null if the element only contains #PCDATA.



getLineNr
public int getLineNr()(Code)
Returns the line number in the data where the element started. the line number, or NO_LINE if unknown.
See Also:   XMLElement.NO_LINE
See Also:   XMLElement.getSystemID



getName
public String getName()(Code)
Returns the name of the element. the name, or null if the element only contains #PCDATA.



getNamespace
public String getNamespace()(Code)
Returns the namespace of the element. the namespace, or null if no namespace is associated with theelement.



getParent
public IXMLElement getParent()(Code)
Returns the parent element. This method returns null for the root element.



getSystemID
public String getSystemID()(Code)
Returns the system ID of the data where the element started. the system ID, or null if unknown.
See Also:   XMLElement.getLineNr



hasAttribute
public boolean hasAttribute(String name)(Code)
Returns whether an attribute exists. true if the attribute exists.



hasAttribute
public boolean hasAttribute(String name, String namespace)(Code)
Returns whether an attribute exists. true if the attribute exists.



hasChildren
public boolean hasChildren()(Code)
Returns whether the element has children. true if the element has children.



insertChild
public void insertChild(IXMLElement child, int index)(Code)
Inserts a child element.
Parameters:
  child - the non-null child to add.
Parameters:
  index - where to put the child.



isLeaf
public boolean isLeaf()(Code)
Returns whether the element is a leaf element. true if the element has no children.



removeAttribute
public void removeAttribute(String name)(Code)
Removes an attribute.
Parameters:
  name - the non-null name of the attribute.



removeAttribute
public void removeAttribute(String name, String namespace)(Code)
Removes an attribute.
Parameters:
  name - the non-null name of the attribute.
Parameters:
  namespace - the namespace URI of the attribute, which may be null.



removeChild
public void removeChild(IXMLElement child)(Code)
Removes a child element.
Parameters:
  child - the non-null child to remove.



removeChildAtIndex
public void removeChildAtIndex(int index)(Code)
Removes the child located at a certain index.
Parameters:
  index - the index of the child, where the first child has index 0.



setAttribute
public void setAttribute(String name, String value)(Code)
Sets an attribute.
Parameters:
  name - the non-null full name of the attribute.
Parameters:
  value - the non-null value of the attribute.



setAttribute
public void setAttribute(String fullName, String namespace, String value)(Code)
Sets an attribute.
Parameters:
  fullName - the non-null full name of the attribute.
Parameters:
  namespace - the namespace URI of the attribute, which may be null.
Parameters:
  value - the non-null value of the attribute.



setContent
public void setContent(String content)(Code)
Sets the #PCDATA content. It is an error to call this method with a non-null value if there are child objects.
Parameters:
  content - the (possibly null) content.



setName
public void setName(String name)(Code)
Sets the full name. This method also sets the short name and clears the namespace URI.
Parameters:
  name - the non-null name.



setName
public void setName(String fullName, String namespace)(Code)
Sets the name.
Parameters:
  fullName - the non-null full name.
Parameters:
  namespace - the namespace URI, which may be null.



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.