|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.dom.NodeWrapper | +--org.apache.batik.dom.DocumentWrapper
This class implements a wrapper for a Document. All the methods of the underlying document are called in a single thread.
Field Summary | |
protected DOMImplementationWrapper |
domImplementationWrapper
The DOMImplementation wrapper. |
protected java.util.Map |
nodes
The node cache. |
Fields inherited from class org.apache.batik.dom.NodeWrapper |
bubblingListeners, capturingListeners, documentWrapper, node |
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 | |
DocumentWrapper(DOMImplementationWrapper diw,
Document doc)
Creates a new DocumentWrapper object. |
Method Summary | |
Attr |
createAttribute(java.lang.String name)
DOM: Implements Document.createAttribute(String) . |
Attr |
createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
DOM: Implements Document.createAttributeNS(String,String) . |
protected Attr |
createAttrWrapper(Attr a)
Creates a wrapper for the given Attr. |
CDATASection |
createCDATASection(java.lang.String data)
DOM: Implements Document.createCDATASection(String) . |
protected CDATASection |
createCDATASectionWrapper(CDATASection c)
Creates a wrapper for the given Comment. |
Comment |
createComment(java.lang.String data)
DOM: Implements Document.createComment(String) . |
protected Comment |
createCommentWrapper(Comment c)
Creates a wrapper for the given Comment. |
DocumentFragment |
createDocumentFragment()
DOM: Implements Document.createDocumentFragment() . |
protected DocumentFragment |
createDocumentFragmentWrapper(DocumentFragment df)
Creates a wrapper for the given DocumentFragment. |
Element |
createElement(java.lang.String tagName)
DOM: Implements Document.createElement(String) . |
Element |
createElementNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
DOM: Implements Document.createElementNS(String,String) . |
protected Element |
createElementWrapper(Element e)
Creates a wrapper for the given element. |
EntityReference |
createEntityReference(java.lang.String name)
DOM: Implements Document.createEntityReference(String) . |
protected EntityReference |
createEntityReferenceWrapper(EntityReference er)
Creates a wrapper for the given EntityReference. |
Event |
createEvent(java.lang.String eventType)
DOM: Implements DocumentEvent.createEvent(String) . |
Event |
createEventWrapper(Event evt)
Creates an EventWrapper. |
protected NamedNodeMap |
createNamedNodeMapWrapper(NamedNodeMap nm)
Creates a wrapper for the given node map. |
protected NodeList |
createNodeListWrapper(NodeList nl)
Creates a wrapper for the given node list. |
Node |
createNodeWrapper(Node n)
Creates a wrapper for the given node. |
ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
DOM: Implements Document.createProcessingInstruction(String,String) . |
protected ProcessingInstruction |
createProcessingInstructionWrapper(ProcessingInstruction pi)
Creates a wrapper for the given ProcessingInstruction. |
Text |
createTextNode(java.lang.String data)
DOM: Implements Document.createTextNode(String) . |
protected Text |
createTextWrapper(Text t)
Creates a wrapper for the given Text. |
DocumentType |
getDoctype()
DOM: Implements Document.getDoctype() . |
Element |
getDocumentElement()
DOM: Implements Document.getDocumentElement() . |
Element |
getElementById(java.lang.String elementId)
DOM: Implements Document.getElementById(String) . |
NodeList |
getElementsByTagName(java.lang.String tagname)
DOM: Implements Document.getElementsByTagName(String) . |
NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
DOM: Implements Document.getElementsByTagNameNS(String,String) . |
DOMImplementation |
getImplementation()
DOM: Implements Document.getImplementation() . |
protected java.lang.Object |
getNode(java.lang.Object o)
Returns the node associated with the given object. |
Node |
importNode(Node importedNode,
boolean deep)
DOM: Implements Document.importNode(Node,boolean) . |
void |
invokeAndWait(java.lang.Runnable r)
Invokes the given Runnable from the associated RunnableQueue thread. |
void |
invokeLater(java.lang.Runnable r)
Invokes the given Runnable from the associated RunnableQueue thread. |
void |
nodeWrapperFinalized(NodeWrapper nw)
Called from the finalize() method of the given object. |
Methods inherited from class org.apache.batik.dom.NodeWrapper |
addEventListener, appendChild, cloneNode, dispatchEvent, finalize, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, removeEventListener, replaceChild, setNodeValue, setPrefix |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Field Detail |
protected java.util.Map nodes
protected DOMImplementationWrapper domImplementationWrapper
Constructor Detail |
public DocumentWrapper(DOMImplementationWrapper diw, Document doc)
Method Detail |
public void nodeWrapperFinalized(NodeWrapper nw)
public DocumentType getDoctype()
Document.getDoctype()
.getDoctype
in interface Document
public DOMImplementation getImplementation()
Document.getImplementation()
.getImplementation
in interface Document
domImplementationWrapper
public Element getDocumentElement()
Document.getDocumentElement()
.getDocumentElement
in interface Document
public Element createElement(java.lang.String tagName) throws DOMException
Document.createElement(String)
.createElement
in interface Document
org.w3c.dom.Document
tagNameThe
- name of the element type to instantiate. For XML,
this is case-sensitive. For HTML, the tagName
parameter may be provided in any case, but it must be mapped to the
canonical uppercase form by the DOM implementation.Element
object with the
nodeName
attribute set to tagName
, and
localName
, prefix
, and
namespaceURI
set to null
.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.public DocumentFragment createDocumentFragment()
Document.createDocumentFragment()
.createDocumentFragment
in interface Document
org.w3c.dom.Document
DocumentFragment
.public Text createTextNode(java.lang.String data)
Document.createTextNode(String)
.createTextNode
in interface Document
org.w3c.dom.Document
dataThe
- data for the node.Text
object.public Comment createComment(java.lang.String data)
Document.createComment(String)
.createComment
in interface Document
org.w3c.dom.Document
dataThe
- data for the node.Comment
object.public CDATASection createCDATASection(java.lang.String data) throws DOMException
Document.createCDATASection(String)
.createCDATASection
in interface Document
org.w3c.dom.Document
dataThe
- data for the CDATASection
contents.CDATASection
object.DOMException
- NOT_SUPPORTED_ERR: Raised if this document is an HTML document.public ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data) throws DOMException
Document.createProcessingInstruction(String,String)
.createProcessingInstruction
in interface Document
org.w3c.dom.Document
targetThe
- target part of the processing instruction.dataThe
- data for the node.ProcessingInstruction
object.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified target contains an
illegal character.
public Attr createAttribute(java.lang.String name) throws DOMException
Document.createAttribute(String)
.createAttribute
in interface Document
org.w3c.dom.Document
nameThe
- name of the attribute.Attr
object with the nodeName
attribute set to name
, and localName
,
prefix
, and namespaceURI
set to
null
. The value of the attribute is the empty string.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.public EntityReference createEntityReference(java.lang.String name) throws DOMException
Document.createEntityReference(String)
.createEntityReference
in interface Document
org.w3c.dom.Document
nameThe
- name of the entity to reference.EntityReference
object.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
public NodeList getElementsByTagName(java.lang.String tagname)
Document.getElementsByTagName(String)
.getElementsByTagName
in interface Document
org.w3c.dom.Document
tagnameThe
- name of the tag to match on. The special value "*"
matches all tags.NodeList
object containing all the matched
Elements
.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 Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws DOMException
Document.createElementNS(String,String)
.createElementNS
in interface Document
org.w3c.dom.Document
namespaceURIThe
- namespace URI of the element to create.qualifiedNameThe
- qualified name of the element type to
instantiate.Element
object with the following
attributes:AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted
from qualifiedName
, or null
if there is
no prefixNode.localName
local name, extracted from
qualifiedName
Element.tagName
qualifiedName
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, or if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace" .public Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws DOMException
Document.createAttributeNS(String,String)
.createAttributeNS
in interface Document
org.w3c.dom.Document
namespaceURIThe
- namespace URI of the attribute to create.qualifiedNameThe
- qualified name of the attribute to instantiate.Attr
object with the following attributes:
AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted from
qualifiedName
, or null
if there is no
prefixNode.localName
local name, extracted from
qualifiedName
Attr.name
qualifiedName
Node.nodeValue
the empty
stringDOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace", or if the
qualifiedName
is "xmlns" and the
namespaceURI
is different from "
http://www.w3.org/2000/xmlns/".public NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
Document.getElementsByTagNameNS(String,String)
.getElementsByTagNameNS
in interface Document
org.w3c.dom.Document
namespaceURIThe
- namespace URI of the elements to match on. The
special value "*" matches all namespaces.localNameThe
- local name of the elements to match on. The
special value "*" matches all local names.NodeList
object containing all the matched
Elements
.public Element getElementById(java.lang.String elementId)
Document.getElementById(String)
.getElementById
in interface Document
org.w3c.dom.Document
elementIdThe
- unique id
value for an element.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 Event createEventWrapper(Event evt)
public void invokeAndWait(java.lang.Runnable r)
invokeAndWait
in class NodeWrapper
public void invokeLater(java.lang.Runnable r)
invokeLater
in class NodeWrapper
public Node createNodeWrapper(Node n)
createNodeWrapper
in class NodeWrapper
protected Element createElementWrapper(Element e)
createElementWrapper
in class NodeWrapper
protected Attr createAttrWrapper(Attr a)
createAttrWrapper
in class NodeWrapper
protected CDATASection createCDATASectionWrapper(CDATASection c)
protected Comment createCommentWrapper(Comment c)
protected EntityReference createEntityReferenceWrapper(EntityReference er)
protected Text createTextWrapper(Text t)
createTextWrapper
in class NodeWrapper
protected DocumentFragment createDocumentFragmentWrapper(DocumentFragment df)
protected ProcessingInstruction createProcessingInstructionWrapper(ProcessingInstruction pi)
protected NodeList createNodeListWrapper(NodeList nl)
createNodeListWrapper
in class NodeWrapper
protected NamedNodeMap createNamedNodeMapWrapper(NamedNodeMap nm)
createNamedNodeMapWrapper
in class NodeWrapper
protected java.lang.Object getNode(java.lang.Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |