|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.dom.AbstractNode | +--org.apache.batik.dom.AbstractParentNode | +--org.apache.batik.dom.AbstractDocument
This class implements the Document
interface.
Inner classes inherited from class org.apache.batik.dom.AbstractParentNode |
AbstractParentNode.ChildNodes, AbstractParentNode.ElementsByTagName, AbstractParentNode.ElementsByTagNameNS |
Field Summary | |
protected DocumentEventSupport |
documentEventSupport
The DocumentEventSupport. |
protected java.util.WeakHashMap |
elementsByTagNames
The ElementsByTagName lists. |
protected java.util.WeakHashMap |
elementsByTagNamesNS
The ElementsByTagNameNS lists. |
protected boolean |
eventsEnabled
Whether the event dispatching must be done. |
protected DOMImplementation |
implementation
The DOM implementation. |
protected LocalizableSupport |
localizableSupport
The localizable support for the error messages. |
protected static java.lang.String |
RESOURCES
The error messages bundle class name. |
protected TraversalSupport |
traversalSupport
The traversal support. |
Fields inherited from class org.apache.batik.dom.AbstractParentNode |
childNodes |
Fields inherited from class org.apache.batik.dom.AbstractNode |
EMPTY_NODE_LIST, eventSupport, ownerDocument |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
protected |
AbstractDocument()
Creates a new document. |
protected |
AbstractDocument(DOMImplementation impl)
Creates a new document. |
Method Summary | |
protected void |
checkChildType(Node n,
boolean replace)
Checks the validity of a node to be inserted. |
Node |
cloneNode(boolean deep)
DOM: Implements Node.cloneNode(boolean) . |
protected Node |
copyInto(Node n)
Copy the fields of the current node into the given node. |
Event |
createEvent(java.lang.String eventType)
DOM: Implements DocumentEvent.createEvent(String) . |
NodeIterator |
createNodeIterator(Node root,
int whatToShow,
NodeFilter filter,
boolean entityReferenceExpansion)
DOM: Implements DocumentTraversal.createNodeIterator(Node,int,NodeFilter,boolean) . |
TreeWalker |
createTreeWalker(Node root,
int whatToShow,
NodeFilter filter,
boolean entityReferenceExpansion)
DOM: Implements DocumentTraversal.createTreeWalker(Node,int,NodeFilter,boolean) . |
protected Node |
deepCopyInto(Node n)
Deeply copy the fields of the current node into the given node. |
protected Node |
deepExport(Node n,
Document d)
Deeply exports this node to the given document. |
void |
detachNodeIterator(NodeIterator it)
Detaches the given node iterator from this document. |
protected Node |
export(Node n,
Document d)
Exports this node to the given document. |
java.lang.String |
formatMessage(java.lang.String key,
java.lang.Object[] args)
Implements Localizable.formatMessage(String,Object[]) . |
protected AbstractDocument |
getCurrentDocument()
Returns the current document. |
DocumentType |
getDoctype()
DOM: Implements Document.getDoctype() . |
Element |
getDocumentElement()
DOM: Implements Document.getDocumentElement() . |
AbstractParentNode.ElementsByTagName |
getElementsByTagName(Node n,
java.lang.String ln)
Returns an ElementsByTagName object from the cache, if any. |
AbstractParentNode.ElementsByTagNameNS |
getElementsByTagNameNS(Node n,
java.lang.String ns,
java.lang.String ln)
Returns an ElementsByTagNameNS object from the cache, if any. |
boolean |
getEventsEnabled()
Tests whether the event dispatching must be done. |
DOMImplementation |
getImplementation()
DOM: Implements Document.getImplementation() . |
java.util.Locale |
getLocale()
Implements Localizable.getLocale() . |
java.lang.String |
getNodeName()
DOM: Implements Node.getNodeName() . |
short |
getNodeType()
DOM: Implements Node.getNodeType() . |
Node |
importNode(Node importedNode,
boolean deep)
DOM: Implements Document.importNode(Node,boolean) . |
void |
nodeToBeRemoved(Node node)
Notifies this document that a node will be removed. |
void |
putElementsByTagName(Node n,
java.lang.String ln,
AbstractParentNode.ElementsByTagName l)
Puts an ElementsByTagName object in the cache. |
void |
putElementsByTagNameNS(Node n,
java.lang.String ns,
java.lang.String ln,
AbstractParentNode.ElementsByTagNameNS l)
Puts an ElementsByTagNameNS object in the cache. |
void |
setDoctype(DocumentType dt)
Sets the document type node. |
void |
setEventsEnabled(boolean b)
Sets the eventsEnabled property. |
void |
setLocale(java.util.Locale l)
Implements Localizable.setLocale(Locale) . |
Methods inherited from class org.apache.batik.dom.AbstractParentNode |
appendChild, checkAndRemove, deepExport, fireDOMNodeInsertedEvent, fireDOMNodeInsertedIntoDocumentEvent, fireDOMNodeRemovedEvent, fireDOMNodeRemovedFromDocumentEvent, fireDOMSubtreeModifiedEvent, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, hasChildNodes, insertBefore, nodeAdded, normalize, removeChild, replaceChild |
Methods inherited from class org.apache.batik.dom.AbstractNode |
addEventListener, createDOMException, dispatchEvent, export, fireDOMCharacterDataModifiedEvent, getAttributes, getEventSupport, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getParentNodeEventTarget, getPrefix, getPreviousSibling, hasAttributes, isSupported, newNode, removeEventListener, setNextSibling, setNodeName, setNodeValue, setOwnerDocument, setParentNode, setPrefix, setPreviousSibling, setSpecified |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Document |
createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getElementById, getElementsByTagName, getElementsByTagNameNS |
Methods inherited from interface org.w3c.dom.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Methods inherited from interface org.apache.batik.dom.ExtendedNode |
isReadonly, setReadonly |
Field Detail |
protected static final java.lang.String RESOURCES
protected transient LocalizableSupport localizableSupport
protected transient DOMImplementation implementation
protected transient TraversalSupport traversalSupport
protected transient DocumentEventSupport documentEventSupport
protected transient boolean eventsEnabled
protected transient java.util.WeakHashMap elementsByTagNames
protected transient java.util.WeakHashMap elementsByTagNamesNS
Constructor Detail |
protected AbstractDocument()
protected AbstractDocument(DOMImplementation impl)
Method Detail |
public void setLocale(java.util.Locale l)
Localizable.setLocale(Locale)
.setLocale
in interface Localizable
org.apache.batik.i18n.Localizable
l
- The locale to set.public java.util.Locale getLocale()
Localizable.getLocale()
.getLocale
in interface Localizable
public java.lang.String formatMessage(java.lang.String key, java.lang.Object[] args) throws java.util.MissingResourceException
Localizable.formatMessage(String,Object[])
.formatMessage
in interface Localizable
org.apache.batik.i18n.Localizable
key
- The key used to retreive the message from the resource
bundle.args
- The objects that compose the message.java.util.MissingResourceException
- if the key is not in the bundle.public boolean getEventsEnabled()
public void setEventsEnabled(boolean b)
public java.lang.String getNodeName()
Node.getNodeName()
.getNodeName
in interface Node
public short getNodeType()
Node.getNodeType()
.getNodeType
in interface Node
Node.DOCUMENT_NODE
public DocumentType getDoctype()
Document.getDoctype()
.getDoctype
in interface Document
public void setDoctype(DocumentType dt)
public DOMImplementation getImplementation()
Document.getImplementation()
.getImplementation
in interface Document
implementation
public Element getDocumentElement()
Document.getDocumentElement()
.getDocumentElement
in interface Document
public Node importNode(Node importedNode, boolean deep) throws DOMException
Document.importNode(Node,boolean)
.importNode
in interface Document
org.w3c.dom.Document
importedNodeThe
- node to import.deepIf
- true
, recursively import the subtree under
the specified node; if false
, import only the node
itself, as explained above. This has no effect on Attr
, EntityReference
, and Notation
nodes.Document
.DOMException
- NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
supported.public Node cloneNode(boolean deep)
Node.cloneNode(boolean)
.cloneNode
in interface Node
cloneNode
in class AbstractNode
org.w3c.dom.Node
deepIf
- true
, recursively clone the subtree under
the specified node; if false
, clone only the node
itself (and its attributes, if it is an Element
).public AbstractParentNode.ElementsByTagName getElementsByTagName(Node n, java.lang.String ln)
public void putElementsByTagName(Node n, java.lang.String ln, AbstractParentNode.ElementsByTagName l)
public AbstractParentNode.ElementsByTagNameNS getElementsByTagNameNS(Node n, java.lang.String ns, java.lang.String ln)
public void putElementsByTagNameNS(Node n, java.lang.String ns, java.lang.String ln, AbstractParentNode.ElementsByTagNameNS l)
public Event createEvent(java.lang.String eventType) throws DOMException
DocumentEvent.createEvent(String)
.createEvent
in interface DocumentEvent
org.w3c.dom.events.DocumentEvent
eventTypeThe
- eventType
parameter specifies the
type of Event
interface to be created. If the
Event
interface specified is supported by the
implementation this method will return a new Event
of
the interface type requested. If the Event
is to be
dispatched via the dispatchEvent
method the
appropriate event init method must be called after creation in
order to initialize the Event
's values. As an example,
a user wishing to synthesize some kind of UIEvent
would call createEvent
with the parameter "UIEvents".
The initUIEvent
method could then be called on the
newly created UIEvent
to set the specific type of
UIEvent to be dispatched and set its context information.The
createEvent
method is used in creating
Event
s when it is either inconvenient or unnecessary
for the user to create an Event
themselves. In cases
where the implementation provided Event
is
insufficient, users may supply their own Event
implementations for use with the dispatchEvent
method.Event
DOMException
- NOT_SUPPORTED_ERR: Raised if the implementation does not support the
type of Event
interface requestedpublic NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) throws DOMException
DocumentTraversal.createNodeIterator(Node,int,NodeFilter,boolean)
.createNodeIterator
in interface DocumentTraversal
org.w3c.dom.traversal.DocumentTraversal
rootThe
- node which will be iterated together with its children.
The iterator is initially positioned just before this node. The
whatToShow
flags and the filter, if any, are not
considered when setting this position. The root must not be
null
.whatToShowThis
- flag specifies which node types may appear in
the logical view of the tree presented by the iterator. See the
description of NodeFilter
for the set of possible
SHOW_
values.These flags can be combined using
OR
.filterThe
- NodeFilter
to be used with this
TreeWalker
, or null
to indicate no filter.entityReferenceExpansionThe
- value of this flag determines
whether entity reference nodes are expanded.NodeIterator
.DOMException
- NOT_SUPPORTED_ERR: Raised if the specified root
is
null
.public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean entityReferenceExpansion) throws DOMException
DocumentTraversal.createTreeWalker(Node,int,NodeFilter,boolean)
.createTreeWalker
in interface DocumentTraversal
org.w3c.dom.traversal.DocumentTraversal
rootThe
- node which will serve as the root
for the
TreeWalker
. The whatToShow
flags and the
NodeFilter
are not considered when setting this value;
any node type will be accepted as the root
. The
currentNode
of the TreeWalker
is
initialized to this node, whether or not it is visible. The
root
functions as a stopping point for traversal
methods that look upward in the document structure, such as
parentNode
and nextNode. The root
must
not be null
.whatToShowThis
- flag specifies which node types may appear in
the logical view of the tree presented by the tree-walker. See the
description of NodeFilter
for the set of possible
SHOW_ values.These flags can be combined using OR
.filterThe
- NodeFilter
to be used with this
TreeWalker
, or null
to indicate no filter.entityReferenceExpansionIf
- this flag is false, the contents of
EntityReference
nodes are not presented in the logical
view.TreeWalker
.DOMException
- NOT_SUPPORTED_ERR: Raised if the specified root
is
null
.public void detachNodeIterator(NodeIterator it)
public void nodeToBeRemoved(Node node)
nodeToBeRemoved
in class AbstractParentNode
protected AbstractDocument getCurrentDocument()
getCurrentDocument
in class AbstractNode
protected Node export(Node n, Document d)
n
- The clone node.d
- The destination document.protected Node deepExport(Node n, Document d)
n
- The clone node.d
- The destination document.protected Node copyInto(Node n)
copyInto
in class AbstractNode
n
- a node of the type of this.protected Node deepCopyInto(Node n)
deepCopyInto
in class AbstractParentNode
n
- a node of the type of this.protected void checkChildType(Node n, boolean replace)
checkChildType
in class AbstractNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |