CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 03:45:13 GMT
content-type: text/html; charset=iso-8859-1
content-encoding: gzip
last-modified: Thu, 09 Nov 2000 23:12:44 GMT
cache-control: max-age=31536000
expires: Mon, 12 Oct 2026 03:45:13 GMT
vary: Accept-Encoding,Origin
access-control-allow-origin: *
x-backend: www-mirrors
x-request-id: 98d39a681f48c19c
strict-transport-security: max-age=15552000; includeSubdomains; preload
content-security-policy: frame-ancestors 'self' https://cms.w3.org/ https://cms-dev.w3.org/; upgrade-insecure-requests
cf-cache-status: BYPASS
set-cookie: __cf_bm=TIFgWYvO1ngal_TsyOp4B2yLpKXPDV1y1MyGffFHhNE-1760240713-1.0.1.1-hbW8rHMnrJynLTfH1kGNq3mX92Bnv3ifMJajoDvHiYg8NVj05hS1fNq1LatsKkotAjr1aFc7OEV8wpqwgeM7gTdGkK0Pb1.xz4bG.vDIuGs; path=/; expires=Sun, 12-Oct-25 04:15:13 GMT; domain=.w3.org; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 98d39a681f48c19c-BLR
alt-svc: h3=":443"; ma=86400
Java Language Binding
13 November, 2000
Appendix B: Java Language Binding
This appendix contains the complete Java Language [Java] binding for the Level 2 Document Object Model Traversal and Range. The definitions are divided into Traversal, and Range.
The Java files are also available as https://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/java-binding.zip
B.1: Document Object Model Traversal
org/w3c/dom/traversal/NodeIterator.java:
package org.w3c.dom.traversal; import org.w3c.dom.Node; import org.w3c.dom.DOMException; public interface NodeIterator { public Node getRoot(); public int getWhatToShow(); public NodeFilter getFilter(); public boolean getExpandEntityReferences(); public Node nextNode() throws DOMException; public Node previousNode() throws DOMException; public void detach(); }
org/w3c/dom/traversal/NodeFilter.java:
package org.w3c.dom.traversal; import org.w3c.dom.Node; public interface NodeFilter { // Constants returned by acceptNode public static final short FILTER_ACCEPT = 1; public static final short FILTER_REJECT = 2; public static final short FILTER_SKIP = 3; // Constants for whatToShow public static final int SHOW_ALL = 0xFFFFFFFF; public static final int SHOW_ELEMENT = 0x00000001; public static final int SHOW_ATTRIBUTE = 0x00000002; public static final int SHOW_TEXT = 0x00000004; public static final int SHOW_CDATA_SECTION = 0x00000008; public static final int SHOW_ENTITY_REFERENCE = 0x00000010; public static final int SHOW_ENTITY = 0x00000020; public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040; public static final int SHOW_COMMENT = 0x00000080; public static final int SHOW_DOCUMENT = 0x00000100; public static final int SHOW_DOCUMENT_TYPE = 0x00000200; public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400; public static final int SHOW_NOTATION = 0x00000800; public short acceptNode(Node n); }
org/w3c/dom/traversal/TreeWalker.java:
package org.w3c.dom.traversal; import org.w3c.dom.Node; import org.w3c.dom.DOMException; public interface TreeWalker { public Node getRoot(); public int getWhatToShow(); public NodeFilter getFilter(); public boolean getExpandEntityReferences(); public Node getCurrentNode(); public void setCurrentNode(Node currentNode) throws DOMException; public Node parentNode(); public Node firstChild(); public Node lastChild(); public Node previousSibling(); public Node nextSibling(); public Node previousNode(); public Node nextNode(); }
org/w3c/dom/traversal/DocumentTraversal.java:
package org.w3c.dom.traversal; import org.w3c.dom.Node; import org.w3c.dom.DOMException; public interface DocumentTraversal { public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) throws DOMException; public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) throws DOMException; }
B.2: Document Object Model Range
org/w3c/dom/ranges/RangeException.java:
package org.w3c.dom.ranges; public class RangeException extends RuntimeException { public RangeException(short code, String message) { super(message); this.code = code; } public short code; // RangeExceptionCode public static final short BAD_BOUNDARYPOINTS_ERR = 1; public static final short INVALID_NODE_TYPE_ERR = 2; }
org/w3c/dom/ranges/Range.java:
package org.w3c.dom.ranges; import org.w3c.dom.Node; import org.w3c.dom.DocumentFragment; import org.w3c.dom.DOMException; public interface Range { public Node getStartContainer() throws DOMException; public int getStartOffset() throws DOMException; public Node getEndContainer() throws DOMException; public int getEndOffset() throws DOMException; public boolean getCollapsed() throws DOMException; public Node getCommonAncestorContainer() throws DOMException; public void setStart(Node refNode, int offset) throws RangeException, DOMException; public void setEnd(Node refNode, int offset) throws RangeException, DOMException; public void setStartBefore(Node refNode) throws RangeException, DOMException; public void setStartAfter(Node refNode) throws RangeException, DOMException; public void setEndBefore(Node refNode) throws RangeException, DOMException; public void setEndAfter(Node refNode) throws RangeException, DOMException; public void collapse(boolean toStart) throws DOMException; public void selectNode(Node refNode) throws RangeException, DOMException; public void selectNodeContents(Node refNode) throws RangeException, DOMException; // CompareHow public static final short START_TO_START = 0; public static final short START_TO_END = 1; public static final short END_TO_END = 2; public static final short END_TO_START = 3; public short compareBoundaryPoints(short how, Range sourceRange) throws DOMException; public void deleteContents() throws DOMException; public DocumentFragment extractContents() throws DOMException; public DocumentFragment cloneContents() throws DOMException; public void insertNode(Node newNode) throws DOMException, RangeException; public void surroundContents(Node newParent) throws DOMException, RangeException; public Range cloneRange() throws DOMException; public String toString() throws DOMException; public void detach() throws DOMException; }
org/w3c/dom/ranges/DocumentRange.java:
package org.w3c.dom.ranges; public interface DocumentRange { public Range createRange(); }