org.apache.batik.dom
Class GenericDocument
java.lang.Object
|
+--org.apache.batik.dom.AbstractNode
|
+--org.apache.batik.dom.AbstractParentNode
|
+--org.apache.batik.dom.AbstractDocument
|
+--org.apache.batik.dom.GenericDocument
- All Implemented Interfaces:
- Document, DocumentEvent, DocumentTraversal, EventTarget, ExtendedNode, Localizable, Node, NodeEventTarget, java.io.Serializable
- public class GenericDocument
- extends AbstractDocument
This class implements the Document
,
DocumentEvent
.
- See Also:
- Serialized Form
Field Summary |
protected boolean |
readonly
Is this document immutable? |
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 |
Methods inherited from class org.apache.batik.dom.AbstractDocument |
checkChildType, cloneNode, copyInto, createEvent, createNodeIterator, createTreeWalker, deepCopyInto, deepExport, detachNodeIterator, export, formatMessage, getCurrentDocument, getDoctype, getDocumentElement, getElementsByTagName, getElementsByTagNameNS, getEventsEnabled, getImplementation, getLocale, getNodeName, getNodeType, importNode, nodeToBeRemoved, putElementsByTagName, putElementsByTagNameNS, setDoctype, setEventsEnabled, setLocale |
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, 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.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
readonly
protected boolean readonly
- Is this document immutable?
GenericDocument
protected GenericDocument()
- Creates a new uninitialized document.
GenericDocument
public GenericDocument(DocumentType dt,
DOMImplementation impl)
- Creates a new uninitialized document.
isReadonly
public boolean isReadonly()
- Tests whether this node is readonly.
setReadonly
public void setReadonly(boolean v)
- Sets this node readonly attribute.
createElement
public Element createElement(java.lang.String tagName)
throws DOMException
- DOM: Implements
Document.createElement(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
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.- Returns:
- A new
Element
object with the
nodeName
attribute set to tagName
, and
localName
, prefix
, and
namespaceURI
set to null
. - Throws:
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
createDocumentFragment
public DocumentFragment createDocumentFragment()
- DOM: Implements
Document.createDocumentFragment()
.- Following copied from interface:
org.w3c.dom.Document
- Returns:
- A new
DocumentFragment
.
createTextNode
public Text createTextNode(java.lang.String data)
- DOM: Implements
Document.createTextNode(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
dataThe
- data for the node.- Returns:
- The new
Text
object.
createComment
public Comment createComment(java.lang.String data)
- DOM: Implements
Document.createComment(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
dataThe
- data for the node.- Returns:
- The new
Comment
object.
createCDATASection
public CDATASection createCDATASection(java.lang.String data)
throws DOMException
- DOM: Implements
Document.createCDATASection(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
dataThe
- data for the CDATASection
contents.- Returns:
- The new
CDATASection
object. - Throws:
DOMException
- NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(java.lang.String target,
java.lang.String data)
throws DOMException
- DOM: Implements
Document.createProcessingInstruction(String,String)
.
- Returns:
- a
StyleSheetProcessingInstruction
if target is
"xml-stylesheet" or a GenericProcessingInstruction otherwise.
getElementById
public Element getElementById(java.lang.String elementId)
- DOM: Implements
Document.getElementById(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
elementIdThe
- unique id
value for an element.- Returns:
- The matching element.
getById
protected static Element getById(java.lang.String id,
Node node)
- An auxiliary method used by getElementById.
createAttribute
public Attr createAttribute(java.lang.String name)
throws DOMException
- DOM: Implements
Document.createAttribute(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
nameThe
- name of the attribute.- Returns:
- A new
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. - Throws:
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
createEntityReference
public EntityReference createEntityReference(java.lang.String name)
throws DOMException
- DOM: Implements
Document.createEntityReference(String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
nameThe
- name of the entity to reference.- Returns:
- The new
EntityReference
object. - Throws:
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
createElementNS
public Element createElementNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
throws DOMException
- DOM: Implements
Document.createElementNS(String,String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
namespaceURIThe
- namespace URI of the element to create.qualifiedNameThe
- qualified name of the element type to
instantiate.- Returns:
- A new
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
- Throws:
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
NAMESPACE_ERR: Raised if the 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" .
createAttributeNS
public Attr createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
throws DOMException
- DOM: Implements
Document.createAttributeNS(String,String)
.- Following copied from interface:
org.w3c.dom.Document
- Parameters:
namespaceURIThe
- namespace URI of the attribute to create.qualifiedNameThe
- qualified name of the attribute to instantiate.- Returns:
- A new
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
string - Throws:
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
NAMESPACE_ERR: Raised if the 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/".
newNode
protected Node newNode()
- Returns a new uninitialized instance of this object's class.
- Overrides:
newNode
in class AbstractNode
Copyright © 2002 Apache Software Foundation. All Rights Reserved.