Java Doc for Document.java in  » XML » xom » nu » xom » 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 » xom » nu.xom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   nu.xom.Node
      nu.xom.ParentNode
         nu.xom.Document

Document
public class Document extends ParentNode (Code)

The Document class represents a complete XML document including its root element, prolog, and epilog.


author:
   Elliotte Rusty Harold
version:
   1.1b5



Constructor Summary
public  Document(Element root)
    

Creates a new Document object with the specified root element.

public  Document(Document doc)
    

Creates a copy of this document.


Method Summary
public  Nodecopy()
    

Returns a complete copy of this document.

final public  StringgetBaseURI()
    

Returns the absolute URI from which this document was loaded.

final public  DocTypegetDocType()
    

Returns this document's document type declaration, or null if it doesn't have one.

final public  ElementgetRootElement()
    

Returns this document's root element.

final public  StringgetValue()
    

Returns the value of the document as defined by XPath 1.0.

final  voidinsertionAllowed(Node child, int position)
    
 booleanisDocument()
    
public  NoderemoveChild(int position)
    

Removes the child of this document at the specified position. Indexes begin at 0 and count up to one less than the number of children of this document.

public  NoderemoveChild(Node child)
    

Removes the specified child from this document.

public  voidreplaceChild(Node oldChild, Node newChild)
    

Replaces an existing child with a new child node. If oldChild is not a child of this node, then a NoSuchChildException is thrown.

public  voidsetBaseURI(String URI)
    

Sets the URI from which this document was loaded, and against which relative URLs in this document will be resolved.

public  voidsetDocType(DocType doctype)
    

Sets this document's document type declaration. If this document already has a document type declaration, then it's inserted at that position.

public  voidsetRootElement(Element root)
    

Replaces the current root element with a different root element.

final public  StringtoString()
    

Returns a string representation of this document suitable for debugging and diagnosis.

final public  StringtoXML()
    

Returns the actual complete, well-formed XML document as a String.



Constructor Detail
Document
public Document(Element root)(Code)

Creates a new Document object with the specified root element.


Parameters:
  root - the root element of this document
throws:
  NullPointerException - if root is null
throws:
  MultipleParentException - if root already has a parent



Document
public Document(Document doc)(Code)

Creates a copy of this document.


Parameters:
  doc - the document to copy
throws:
  NullPointerException - if doc is null




Method Detail
copy
public Node copy()(Code)

Returns a complete copy of this document.

a deep copy of this Document object



getBaseURI
final public String getBaseURI()(Code)

Returns the absolute URI from which this document was loaded. This method returns the empty string if the base URI is not known; for instance if the document was created in memory with a constructor rather than by parsing an existing document.

the base URI of this document



getDocType
final public DocType getDocType()(Code)

Returns this document's document type declaration, or null if it doesn't have one.

the document type declaration
See Also:   Document.setDocType



getRootElement
final public Element getRootElement()(Code)

Returns this document's root element. This is guaranteed to be non-null.

the root element



getValue
final public String getValue()(Code)

Returns the value of the document as defined by XPath 1.0. This is the same as the value of the root element, which is the complete PCDATA content of the root element, without any tags, comments, or processing instructions after all entity and character references have been resolved.

value of the root element of this document



insertionAllowed
final void insertionAllowed(Node child, int position)(Code)



isDocument
boolean isDocument()(Code)



removeChild
public Node removeChild(int position)(Code)

Removes the child of this document at the specified position. Indexes begin at 0 and count up to one less than the number of children of this document. The root element cannot be removed. Instead, use setRootElement to replace the existing root element with a different element.


Parameters:
  position - index of the node to remove the node which was removed
throws:
  IndexOutOfBoundsException - if the index is negative or greater than the number of children of this document - 1
throws:
  WellformednessException - if the index points to the root element



removeChild
public Node removeChild(Node child)(Code)

Removes the specified child from this document. The root element cannot be removed. Instead, use setRootElement to replace the existing root element with a different element.


Parameters:
  child - node to remove the node which was removed
throws:
  NoSuchChildException - if the node is not achild of this node
throws:
  WellformednessException - if child is the root element



replaceChild
public void replaceChild(Node oldChild, Node newChild)(Code)

Replaces an existing child with a new child node. If oldChild is not a child of this node, then a NoSuchChildException is thrown. The root element can only be replaced by another element.


Parameters:
  oldChild - the node removed from the tree
Parameters:
  newChild - the node inserted into the tree
throws:
  MultipleParentException - if newChild alreadyhas a parent
throws:
  NoSuchChildException - if oldChild is not a child of this node
throws:
  NullPointerException - if either argument is null
throws:
  IllegalAddException - if newChild is anattribute or a text node
throws:
  WellformednessException - if newChild oldChild is an element and newChild is not



setBaseURI
public void setBaseURI(String URI)(Code)

Sets the URI from which this document was loaded, and against which relative URLs in this document will be resolved. Setting the base URI to null or the empty string removes any existing base URI.


Parameters:
  URI - the base URI of this document
throws:
  MalformedURIException - if URI is not a legal absolute URI



setDocType
public void setDocType(DocType doctype)(Code)

Sets this document's document type declaration. If this document already has a document type declaration, then it's inserted at that position. Otherwise, it's inserted at the beginning of the document.


Parameters:
  doctype - the document type declaration
throws:
  MultipleParentException - if doctype belongs to another document
throws:
  NullPointerException - if doctype is null



setRootElement
public void setRootElement(Element root)(Code)

Replaces the current root element with a different root element.


Parameters:
  root - the new root element
throws:
  MultipleParentException - if root has a parent
throws:
  NullPointerException - if root is null



toString
final public String toString()(Code)

Returns a string representation of this document suitable for debugging and diagnosis. This is not the XML representation of this document.

a non-XML string representation of this document



toXML
final public String toXML()(Code)

Returns the actual complete, well-formed XML document as a String. Significant white space is preserved. Insignificant white space in tags, the prolog, the epilog, and the internal DTD subset is not preserved. Entity and character references are not preserved. The entire document is contained in this one string.

a string containing this entire XML document



Fields inherited from nu.xom.ParentNode
String actualBaseURI(Code)(Java Doc)
int childCount(Code)(Java Doc)
Node[] children(Code)(Java Doc)

Methods inherited from nu.xom.ParentNode
final void _insertChild(Node child, int position)(Code)(Java Doc)
public void appendChild(Node child)(Code)(Java Doc)
void fastInsertChild(Node child, int position)(Code)(Java Doc)
void fillInBaseURI(Element removed)(Code)(Java Doc)
final String findActualBaseURI()(Code)(Java Doc)
String getActualBaseURI()(Code)(Java Doc)
public Node getChild(int position)(Code)(Java Doc)
public int getChildCount()(Code)(Java Doc)
public int indexOf(Node child)(Code)(Java Doc)
public void insertChild(Node child, int position)(Code)(Java Doc)
abstract void insertionAllowed(Node child, int position)(Code)(Java Doc)
public Node removeChild(int position)(Code)(Java Doc)
public Node removeChild(Node child)(Code)(Java Doc)
public void replaceChild(Node oldChild, Node newChild)(Code)(Java Doc)
void setActualBaseURI(String uri)(Code)(Java Doc)
abstract public void setBaseURI(String URI)(Code)(Java Doc)

Methods inherited from nu.xom.Node
abstract public Node copy()(Code)(Java Doc)
public void detach()(Code)(Java Doc)
final public boolean equals(Object o)(Code)(Java Doc)
public String getBaseURI()(Code)(Java Doc)
abstract public Node getChild(int position)(Code)(Java Doc)
abstract public int getChildCount()(Code)(Java Doc)
final public Document getDocument()(Code)(Java Doc)
final public ParentNode getParent()(Code)(Java Doc)
final Node getRoot()(Code)(Java Doc)
abstract public String getValue()(Code)(Java Doc)
final public int hashCode()(Code)(Java Doc)
boolean isAttribute()(Code)(Java Doc)
boolean isComment()(Code)(Java Doc)
boolean isDocType()(Code)(Java Doc)
boolean isDocument()(Code)(Java Doc)
boolean isDocumentFragment()(Code)(Java Doc)
boolean isElement()(Code)(Java Doc)
boolean isProcessingInstruction()(Code)(Java Doc)
boolean isText()(Code)(Java Doc)
final public Nodes query(String xpath, XPathContext namespaces)(Code)(Java Doc)
final public Nodes query(String xpath)(Code)(Java Doc)
final void setParent(ParentNode parent)(Code)(Java Doc)
abstract public String toXML()(Code)(Java Doc)

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.