|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.batik.dom.AbstractNode
org.apache.batik.dom.AbstractParentNode
org.apache.batik.dom.AbstractDocument
public abstract class AbstractDocument
This class implements the Document interface.
| Nested Class Summary | |
|---|---|
protected class |
AbstractDocument.DocumentConfiguration
DOMConfiguration for this document. |
protected class |
AbstractDocument.DocumentError
DOMError implementation. |
protected class |
AbstractDocument.IdSoftRef
|
protected class |
AbstractDocument.XPathExpr
A compiled XPath expression. |
protected class |
AbstractDocument.XPathNodeNSResolver
An XPathNSResolver that uses Node.lookupNamespaceURI. |
| Nested classes/interfaces inherited from class org.apache.batik.dom.AbstractParentNode |
|---|
AbstractParentNode.ChildNodes, AbstractParentNode.ElementsByTagName, AbstractParentNode.ElementsByTagNameNS |
| Field Summary | |
|---|---|
protected DocumentEventSupport |
documentEventSupport
The DocumentEventSupport. |
protected String |
documentURI
The document URI. |
protected AbstractDocument.DocumentConfiguration |
domConfig
The DOMConfiguration object for this document. |
protected Map |
elementsById
The elementsById lists. |
protected WeakHashMap |
elementsByTagNames
The ElementsByTagName lists. |
protected WeakHashMap |
elementsByTagNamesNS
The ElementsByTagNameNS lists. |
protected boolean |
eventsEnabled
Whether the event dispatching must be done. |
protected DOMImplementation |
implementation
The DOM implementation. |
protected String |
inputEncoding
Input encoding of this document. |
protected org.apache.batik.i18n.LocalizableSupport |
localizableSupport
The localizable support for the error messages. |
protected static String |
RESOURCES
The error messages bundle class name. |
protected boolean |
strictErrorChecking
Whether strict error checking is in force. |
protected TraversalSupport |
traversalSupport
The traversal support. |
protected XBLManager |
xblManager
The XBL manager for this document. |
protected String |
xmlEncoding
XML encoding of this document. |
protected boolean |
xmlStandalone
Whether this document is standalone. |
protected String |
xmlVersion
XML version of this document. |
| Fields inherited from class org.apache.batik.dom.AbstractParentNode |
|---|
childNodes |
| Fields inherited from class org.apache.batik.dom.AbstractNode |
|---|
DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, EMPTY_NODE_LIST, eventSupport, managerData, ownerDocument, userData, userDataHandlers |
| Constructor Summary | |
|---|---|
protected |
AbstractDocument()
Creates a new document. |
|
AbstractDocument(DocumentType dt,
DOMImplementation impl)
Creates a new document. |
| Method Summary | |
|---|---|
void |
addIdEntry(Element e,
String id)
|
Node |
adoptNode(Node n)
DOM: Implements Document.adoptNode(Node). |
protected void |
adoptNode1(AbstractNode n)
Helper function for adoptNode(Node). |
boolean |
canDispatch(String ns,
String eventType)
DOM: Implements org.w3c.dom.events.DocumentEvent#canDispatch(String,String). |
protected boolean |
checkChars(String s)
Checks that the characters in the given string are all valid content characters. |
protected void |
checkChildType(Node n,
boolean replace)
Checks the validity of a node to be inserted. |
protected boolean |
checkName(String s)
Checks that the given string is a valid XML name. |
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. |
protected DOMError |
createDOMError(String type,
short severity,
String key,
Object[] args,
Node related,
Exception e)
Creates a DOMError object with the given parameters. |
Event |
createEvent(String eventType)
DOM: Implements DocumentEvent.createEvent(String). |
org.w3c.dom.xpath.XPathExpression |
createExpression(String expression,
org.w3c.dom.xpath.XPathNSResolver resolver)
DOM: Implements XPathEvaluator.createExpression(String,XPathNSResolver). |
org.w3c.dom.traversal.NodeIterator |
createNodeIterator(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
DOM: Implements DocumentTraversal.createNodeIterator(Node,int,NodeFilter,boolean). |
org.w3c.dom.xpath.XPathNSResolver |
createNSResolver(Node n)
DOM: Implements XPathEvaluator.createNSResolver(Node). |
org.w3c.dom.traversal.TreeWalker |
createTreeWalker(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
DOM: Implements DocumentTraversal.createTreeWalker(Node,int,NodeFilter,boolean). |
org.w3c.dom.xpath.XPathException |
createXPathException(short type,
String key,
Object[] args)
Creates an exception with the appropriate error message. |
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(org.w3c.dom.traversal.NodeIterator it)
Detaches the given node iterator from this document. |
Object |
evaluate(String expression,
Node contextNode,
org.w3c.dom.xpath.XPathNSResolver resolver,
short type,
Object result)
DOM: Implements XPathEvaluator.evaluate(String,Node,XPathNSResolver,short,Object). |
protected Node |
export(Node n,
Document d)
Exports this node to the given document. |
String |
formatMessage(String key,
Object[] args)
Implements Localizable.formatMessage(String,Object[]). |
Element |
getChildElementById(Node requestor,
String id)
Finds an element that is in the same document fragment as 'requestor' that has 'id'. |
protected AbstractDocument |
getCurrentDocument()
Returns the current document. |
DocumentType |
getDoctype()
DOM: Implements Document.getDoctype(). |
Element |
getDocumentElement()
DOM: Implements Document.getDocumentElement(). |
String |
getDocumentURI()
DOM: Implements Document.getDocumentURI(). |
DOMConfiguration |
getDomConfig()
DOM: Implements Document.getDomConfig(). |
Element |
getElementById(String id)
DOM: Implements Document.getElementById(String). |
AbstractParentNode.ElementsByTagName |
getElementsByTagName(Node n,
String ln)
Returns an ElementsByTagName object from the cache, if any. |
AbstractParentNode.ElementsByTagNameNS |
getElementsByTagNameNS(Node n,
String ns,
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(). |
String |
getInputEncoding()
DOM: Implements Document.getInputEncoding(). |
Locale |
getLocale()
Implements Localizable.getLocale(). |
String |
getNodeName()
DOM: Implements Node.getNodeName(). |
short |
getNodeType()
DOM: Implements Node.getNodeType(). |
protected Node |
getRoot(Node n)
|
boolean |
getStrictErrorChecking()
DOM: Implements Document.getStrictErrorChecking(). |
Element |
getXblBoundElement()
Get the bound element whose shadow tree this current node resides in. |
NodeList |
getXblChildNodes()
Get the list of child nodes of this node in the fully flattened tree. |
NodeList |
getXblDefinitions()
Get the xbl:definition elements currently binding this element. |
Node |
getXblFirstChild()
Get the first child node of this node in the fully flattened tree. |
Element |
getXblFirstElementChild()
Get the first element child of this node in the fully flattened tree. |
Node |
getXblLastChild()
Get the last child node of this node in the fully flattened tree. |
Element |
getXblLastElementChild()
Get the last element child of this node in the fully flattened tree. |
XBLManager |
getXBLManager()
Returns the XBLManager used for this document. |
Element |
getXblNextElementSibling()
Get the first element that follows the current node in the xblParentNode's xblChildNodes list. |
Node |
getXblNextSibling()
Get the node which directly follows the current node in the xblParentNode's xblChildNodes list. |
Node |
getXblParentNode()
Get the parent of this node in the fully flattened tree. |
Element |
getXblPreviousElementSibling()
Get the first element that precedes the current node in the xblParentNode's xblChildNodes list. |
Node |
getXblPreviousSibling()
Get the node which directly precedes the current node in the xblParentNode's xblChildNodes list. |
NodeList |
getXblScopedChildNodes()
Get the list of child nodes of this node in the fully flattened tree that are within the same shadow scope. |
Element |
getXblShadowTree()
Get the shadow tree of this node. |
String |
getXmlEncoding()
DOM: Implements Document.getXmlEncoding(). |
boolean |
getXmlStandalone()
DOM: Implements Document.getXmlStandalone(). |
String |
getXmlVersion()
DOM: Implements Document.getXmlVersion(). |
Node |
importNode(Node importedNode,
boolean deep)
DOM: Implements Document.importNode(Node,boolean). |
Node |
importNode(Node importedNode,
boolean deep,
boolean trimId)
Imports the given node into this document. |
abstract boolean |
isId(Attr node)
Returns whether the given attribute node is an ID attribute. |
void |
nodeToBeRemoved(Node node)
Notifies this document that a node will be removed. |
void |
normalizeDocument()
DOM: Implements Document.normalizeDocument(). |
protected boolean |
normalizeDocument(Element e,
boolean cdataSections,
boolean comments,
boolean elementContentWhitepace,
boolean namespaceDeclarations,
boolean namespaces,
boolean splitCdataSections,
DOMErrorHandler errorHandler)
Helper function for normalizeDocument(). |
void |
putElementsByTagName(Node n,
String ln,
AbstractParentNode.ElementsByTagName l)
Puts an ElementsByTagName object in the cache. |
void |
putElementsByTagNameNS(Node n,
String ns,
String ln,
AbstractParentNode.ElementsByTagNameNS l)
Puts an ElementsByTagNameNS object in the cache. |
void |
removeIdEntry(Element e,
String id)
Remove the mapping for element to id |
Node |
renameNode(Node n,
String ns,
String qn)
DOM: Implements Document.renameNode(Node,String,String). |
void |
setDoctype(DocumentType dt)
Sets the document type node. |
void |
setDocumentInputEncoding(String ie)
Sets the input encoding that was used when the document was being parsed. |
void |
setDocumentURI(String uri)
DOM: Implements Document.setDocumentURI(String). |
void |
setDocumentXmlEncoding(String xe)
Sets the XML encoding that was found in the XML prolog. |
void |
setEventsEnabled(boolean b)
Sets the eventsEnabled property. |
void |
setLocale(Locale l)
Implements Localizable.setLocale(Locale). |
void |
setStrictErrorChecking(boolean b)
DOM: Implements Document.setStrictErrorChecking(boolean). |
void |
setTextContent(String s)
DOM: Implements Node.setTextContent(String). |
void |
setXBLManager(XBLManager m)
Sets the XBLManager used for this document. |
void |
setXmlStandalone(boolean b)
DOM: Implements Document.setXmlStandalone(boolean). |
void |
setXmlVersion(String v)
DOM: Implements Document.setXmlVersion(String). |
protected boolean |
splitCdata(Element e,
Node n,
DOMErrorHandler errorHandler)
Splits the given CDATA node if required. |
void |
updateIdEntry(Element e,
String oldId,
String newId)
|
| 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, getElementsByTagName, getElementsByTagNameNS |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setUserData |
| Methods inherited from interface org.apache.batik.dom.ExtendedNode |
|---|
isReadonly, setReadonly |
| Field Detail |
|---|
protected static final String RESOURCES
protected transient org.apache.batik.i18n.LocalizableSupport localizableSupport
protected transient DOMImplementation implementation
protected transient TraversalSupport traversalSupport
protected transient DocumentEventSupport documentEventSupport
protected transient boolean eventsEnabled
protected transient WeakHashMap elementsByTagNames
protected transient WeakHashMap elementsByTagNamesNS
protected String inputEncoding
protected String xmlEncoding
protected String xmlVersion
protected boolean xmlStandalone
protected String documentURI
protected boolean strictErrorChecking
protected AbstractDocument.DocumentConfiguration domConfig
protected transient XBLManager xblManager
protected transient Map elementsById
| Constructor Detail |
|---|
protected AbstractDocument()
public AbstractDocument(DocumentType dt,
DOMImplementation impl)
| Method Detail |
|---|
public void setDocumentInputEncoding(String ie)
public void setDocumentXmlEncoding(String xe)
public void setLocale(Locale l)
Localizable.setLocale(Locale).
setLocale in interface org.apache.batik.i18n.Localizablepublic Locale getLocale()
Localizable.getLocale().
getLocale in interface org.apache.batik.i18n.Localizable
public String formatMessage(String key,
Object[] args)
throws MissingResourceException
Localizable.formatMessage(String,Object[]).
formatMessage in interface org.apache.batik.i18n.LocalizableMissingResourceExceptionpublic boolean getEventsEnabled()
public void setEventsEnabled(boolean b)
public String getNodeName()
Node.getNodeName().
getNodeName in interface Nodepublic short getNodeType()
Node.getNodeType().
getNodeType in interface NodeNode.DOCUMENT_NODEpublic DocumentType getDoctype()
Document.getDoctype().
getDoctype in interface Documentpublic void setDoctype(DocumentType dt)
public DOMImplementation getImplementation()
Document.getImplementation().
getImplementation in interface Documentimplementationpublic Element getDocumentElement()
Document.getDocumentElement().
getDocumentElement in interface Document
public Node importNode(Node importedNode,
boolean deep)
throws DOMException
Document.importNode(Node,boolean).
importNode in interface DocumentDOMException
public Node importNode(Node importedNode,
boolean deep,
boolean trimId)
deep is set to true.
It will not mark ID attributes as IDs if trimId is set to
true. This is used primarily for the shadow trees of the 'use' elements
so they don't clutter the hash table.
importedNode - The node to import into this document.deep - Whether to perform a deep importation.trimId - Whether to make all cloned attributes not be ID attributes.public Node cloneNode(boolean deep)
Node.cloneNode(boolean).
cloneNode in interface NodecloneNode in class AbstractNodepublic abstract boolean isId(Attr node)
public Element getElementById(String id)
Document.getElementById(String).
getElementById in interface Document
public Element getChildElementById(Node requestor,
String id)
protected Node getRoot(Node n)
public void removeIdEntry(Element e,
String id)
element to id
public void addIdEntry(Element e,
String id)
public void updateIdEntry(Element e,
String oldId,
String newId)
public AbstractParentNode.ElementsByTagName getElementsByTagName(Node n,
String ln)
public void putElementsByTagName(Node n,
String ln,
AbstractParentNode.ElementsByTagName l)
public AbstractParentNode.ElementsByTagNameNS getElementsByTagNameNS(Node n,
String ns,
String ln)
public void putElementsByTagNameNS(Node n,
String ns,
String ln,
AbstractParentNode.ElementsByTagNameNS l)
public Event createEvent(String eventType)
throws DOMException
DocumentEvent.createEvent(String).
createEvent in interface DocumentEventDOMException
public boolean canDispatch(String ns,
String eventType)
org.w3c.dom.events.DocumentEvent#canDispatch(String,String).
public org.w3c.dom.traversal.NodeIterator createNodeIterator(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
throws DOMException
DocumentTraversal.createNodeIterator(Node,int,NodeFilter,boolean).
createNodeIterator in interface org.w3c.dom.traversal.DocumentTraversalDOMException
public org.w3c.dom.traversal.TreeWalker createTreeWalker(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
throws DOMException
DocumentTraversal.createTreeWalker(Node,int,NodeFilter,boolean).
createTreeWalker in interface org.w3c.dom.traversal.DocumentTraversalDOMExceptionpublic void detachNodeIterator(org.w3c.dom.traversal.NodeIterator it)
public void nodeToBeRemoved(Node node)
nodeToBeRemoved in class AbstractParentNodeprotected 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 AbstractNoden - a node of the type of this.protected Node deepCopyInto(Node n)
deepCopyInto in class AbstractParentNoden - a node of the type of this.
protected void checkChildType(Node n,
boolean replace)
checkChildType in class AbstractNodepublic String getInputEncoding()
Document.getInputEncoding().
getInputEncoding in interface Documentpublic String getXmlEncoding()
Document.getXmlEncoding().
getXmlEncoding in interface Documentpublic boolean getXmlStandalone()
Document.getXmlStandalone().
getXmlStandalone in interface Document
public void setXmlStandalone(boolean b)
throws DOMException
Document.setXmlStandalone(boolean).
setXmlStandalone in interface DocumentDOMExceptionpublic String getXmlVersion()
Document.getXmlVersion().
getXmlVersion in interface Document
public void setXmlVersion(String v)
throws DOMException
Document.setXmlVersion(String).
setXmlVersion in interface DocumentDOMExceptionpublic boolean getStrictErrorChecking()
Document.getStrictErrorChecking().
getStrictErrorChecking in interface Documentpublic void setStrictErrorChecking(boolean b)
Document.setStrictErrorChecking(boolean).
setStrictErrorChecking in interface Documentpublic String getDocumentURI()
Document.getDocumentURI().
getDocumentURI in interface Documentpublic void setDocumentURI(String uri)
Document.setDocumentURI(String).
setDocumentURI in interface Documentpublic DOMConfiguration getDomConfig()
Document.getDomConfig().
getDomConfig in interface Document
public Node adoptNode(Node n)
throws DOMException
Document.adoptNode(Node).
adoptNode in interface DocumentDOMExceptionprotected void adoptNode1(AbstractNode n)
adoptNode(Node).
public Node renameNode(Node n,
String ns,
String qn)
Document.renameNode(Node,String,String).
renameNode in interface Documentpublic void normalizeDocument()
Document.normalizeDocument().
XXX Does not handle the 'entities' parameter yet.
normalizeDocument in interface Document
protected boolean normalizeDocument(Element e,
boolean cdataSections,
boolean comments,
boolean elementContentWhitepace,
boolean namespaceDeclarations,
boolean namespaces,
boolean splitCdataSections,
DOMErrorHandler errorHandler)
normalizeDocument().
protected boolean splitCdata(Element e,
Node n,
DOMErrorHandler errorHandler)
protected boolean checkChars(String s)
protected boolean checkName(String s)
protected DOMError createDOMError(String type,
short severity,
String key,
Object[] args,
Node related,
Exception e)
public void setTextContent(String s)
throws DOMException
Node.setTextContent(String).
setTextContent in interface NodesetTextContent in class AbstractNodeDOMExceptionpublic void setXBLManager(XBLManager m)
public XBLManager getXBLManager()
public org.w3c.dom.xpath.XPathExpression createExpression(String expression,
org.w3c.dom.xpath.XPathNSResolver resolver)
throws DOMException,
org.w3c.dom.xpath.XPathException
XPathEvaluator.createExpression(String,XPathNSResolver).
createExpression in interface org.w3c.dom.xpath.XPathEvaluatorDOMException
org.w3c.dom.xpath.XPathExceptionpublic org.w3c.dom.xpath.XPathNSResolver createNSResolver(Node n)
XPathEvaluator.createNSResolver(Node).
createNSResolver in interface org.w3c.dom.xpath.XPathEvaluator
public Object evaluate(String expression,
Node contextNode,
org.w3c.dom.xpath.XPathNSResolver resolver,
short type,
Object result)
throws org.w3c.dom.xpath.XPathException,
DOMException
XPathEvaluator.evaluate(String,Node,XPathNSResolver,short,Object).
evaluate in interface org.w3c.dom.xpath.XPathEvaluatororg.w3c.dom.xpath.XPathException
DOMException
public org.w3c.dom.xpath.XPathException createXPathException(short type,
String key,
Object[] args)
public Node getXblParentNode()
getXblParentNode in interface NodeXBLgetXblParentNode in class AbstractNodepublic NodeList getXblChildNodes()
getXblChildNodes in interface NodeXBLgetXblChildNodes in class AbstractNodepublic NodeList getXblScopedChildNodes()
getXblScopedChildNodes in interface NodeXBLgetXblScopedChildNodes in class AbstractNodepublic Node getXblFirstChild()
getXblFirstChild in interface NodeXBLgetXblFirstChild in class AbstractNodepublic Node getXblLastChild()
getXblLastChild in interface NodeXBLgetXblLastChild in class AbstractNodepublic Node getXblPreviousSibling()
getXblPreviousSibling in interface NodeXBLgetXblPreviousSibling in class AbstractNodepublic Node getXblNextSibling()
getXblNextSibling in interface NodeXBLgetXblNextSibling in class AbstractNodepublic Element getXblFirstElementChild()
getXblFirstElementChild in interface NodeXBLgetXblFirstElementChild in class AbstractNodepublic Element getXblLastElementChild()
getXblLastElementChild in interface NodeXBLgetXblLastElementChild in class AbstractNodepublic Element getXblPreviousElementSibling()
getXblPreviousElementSibling in interface NodeXBLgetXblPreviousElementSibling in class AbstractNodepublic Element getXblNextElementSibling()
getXblNextElementSibling in interface NodeXBLgetXblNextElementSibling in class AbstractNodepublic Element getXblBoundElement()
getXblBoundElement in interface NodeXBLgetXblBoundElement in class AbstractNodepublic Element getXblShadowTree()
getXblShadowTree in interface NodeXBLgetXblShadowTree in class AbstractNodepublic NodeList getXblDefinitions()
getXblDefinitions in interface NodeXBLgetXblDefinitions in class AbstractNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||