Top Description Fields Constructors Methods
org.apache.xerces.dom

public Class PSVIDocumentImpl

extends DocumentImpl
Class Inheritance
Imports
java.io.IOException, .NotSerializableException, .ObjectInputStream, .ObjectOutputStream, org.w3c.dom.Attr, .DOMConfiguration, .DOMException, .DOMImplementation, .DocumentType, .Element, .Node, .UserDataHandler

Our own document implementation, which knows how to create an element with PSVI information.
Author
Sandy Gao, IBM
Version
$Id: PSVIDocumentImpl.java 699892 2008-09-28 21:08:27Z mrglavas $

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from org.apache.xerces.dom.DocumentImpl:
eventListenersiteratorReferenceQueueiteratorsmutationEventsrangeReferenceQueuerangessavedEnclosingAttr

Constructor Summary

AccessConstructor and Description
public
PSVIDocumentImpl()

Create a document.

public
PSVIDocumentImpl(DocumentType doctype)

For DOM2 support.

Method Summary

Modifier and TypeMethod and Description
public Node

Returns:

org.w3c.dom.Node
cloneNode
(boolean
boolean, iff true replicate children
deep
)

Overrides org.apache.xerces.dom.DocumentImpl.cloneNode.

Implements org.w3c.dom.Node.cloneNode.

Deep-clone a document, including fixing ownerDoc for the cloned children.
public Attr
createAttributeNS(String
The namespace URI of the attribute to create. When it is null or an empty string, this method behaves like createAttribute.
namespaceURI
,
String
The qualified name of the attribute to instantiate.
qualifiedName
)

Overrides org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

Implements org.w3c.dom.Document.createAttributeNS.

Create an attribute with PSVI information
public Attr
createAttributeNS(String
The namespace URI of the attribute to create. When it is null or an empty string, this method behaves like createAttribute.
namespaceURI
,
String
The qualified name of the attribute to instantiate.
qualifiedName
,
String
The local name of the attribute to instantiate.
localName
)

Overrides org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

Create an attribute with PSVI information
public Element
createElementNS(String
The namespace URI of the element to create.
namespaceURI
,
String
The qualified name of the element type to instantiate.
qualifiedName
)

Overrides org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

Implements org.w3c.dom.Document.createElementNS.

Create an element with PSVI information
public Element
createElementNS(String
The namespace URI of the element to create.
namespaceURI
,
String
The qualified name of the element type to instantiate.
qualifiedName
,
String
The local name of the attribute to instantiate.
localpart
)

Overrides org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

Create an element with PSVI information
public DOMConfiguration
getDomConfig()

Overrides org.apache.xerces.dom.CoreDocumentImpl.getDomConfig.

Implements org.w3c.dom.Document.getDomConfig.

The configuration used when Document.normalizeDocument is invoked.
public DOMImplementation
getImplementation()

Overrides org.apache.xerces.dom.DocumentImpl.getImplementation.

Implements org.w3c.dom.Document.getImplementation.

Retrieve information describing the abilities of this particular DOM implementation.
private void
readObject(ObjectInputStream in)

Hides org.apache.xerces.dom.CoreDocumentImpl.readObject.

The serialized forms of the user data and node table maps are Hashtables.
private void
writeObject(ObjectOutputStream out)

Hides org.apache.xerces.dom.CoreDocumentImpl.writeObject.

To allow DOM trees serialized by newer versions of Xerces to be read by older versions briefly move the user data and node table into Hashtables.
Inherited from org.apache.xerces.dom.DocumentImpl:
addEventListenercopyEventListenerscreateEventcreateNodeIteratorcreateNodeIteratorcreateRangecreateTreeWalkercreateTreeWalkerdeletedTextdispatchAggregateEventsdispatchAggregateEventsdispatchEventdispatchEventToSubtreedispatchingEventToSubtreegetEventListenersgetMutationEventsinsertedNodeinsertedTextinsertingNodemodifiedAttrValuemodifiedCharacterDatamodifyingCharacterDataremovedAttrNoderemovedNoderemoveEventListenerremoveNodeIteratorremoveRangeremovingNoderenamedAttrNoderenamedElementreplacedCharacterDatareplacedNodereplacedTextreplacingDatareplacingNodesaveEnclosingAttrsetAttrNodesetEventListenerssetMutationEventssplitData

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides org.apache.xerces.dom.DocumentImpl.serialVersionUID.

Serialization version.

Constructor Detail

PSVIDocumentImplback to summary
public PSVIDocumentImpl()

Create a document.

PSVIDocumentImplback to summary
public PSVIDocumentImpl(DocumentType doctype)

For DOM2 support. The createDocument factory method is in DOMImplementation.

Method Detail

cloneNodeback to summary
public Node cloneNode(boolean deep)

Overrides org.apache.xerces.dom.DocumentImpl.cloneNode.

Implements org.w3c.dom.Node.cloneNode.

Deep-clone a document, including fixing ownerDoc for the cloned children. Note that this requires bypassing the WRONG_DOCUMENT_ERR protection. I've chosen to implement it by calling importNode which is DOM Level 2.

Parameters
deep:boolean

boolean, iff true replicate children

Returns:Node

org.w3c.dom.Node

createAttributeNSback to summary
public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException

Overrides org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

Implements org.w3c.dom.Document.createAttributeNS.

Create an attribute with PSVI information

Parameters
namespaceURI:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

The namespace URI of the attribute to create. When it is null or an empty string, this method behaves like createAttribute.

qualifiedName:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

The qualified name of the attribute to instantiate.

Returns:Attr

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

Attr A new Attr object.

Exceptions
DOMException:

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createAttributeNSback to summary
public Attr createAttributeNS(String namespaceURI, String qualifiedName, String localName) throws DOMException

Overrides org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

Create an attribute with PSVI information

Parameters
namespaceURI:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

The namespace URI of the attribute to create. When it is null or an empty string, this method behaves like createAttribute.

qualifiedName:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

The qualified name of the attribute to instantiate.

localName:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

The local name of the attribute to instantiate.

Returns:Attr

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

Attr A new Attr object.

Exceptions
DOMException:

Doc from org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS.

INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

createElementNSback to summary
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException

Overrides org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

Implements org.w3c.dom.Document.createElementNS.

Create an element with PSVI information

Parameters
namespaceURI:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

The namespace URI of the element to create.

qualifiedName:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

The qualified name of the element type to instantiate.

Returns:Element

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

Element A new Element object with the following attributes:

Exceptions
DOMException:

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

  • INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
  • NAMESPACE_ERR: Raised if the qualifiedName has a prefix that is "xml" and the namespaceURI is neither null nor an empty string nor "http://www.w3.org/XML/1998/namespace", or if the qualifiedName has a prefix different from "xml" and the namespaceURI is null or an empty string.
createElementNSback to summary
public Element createElementNS(String namespaceURI, String qualifiedName, String localpart) throws DOMException

Overrides org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

Create an element with PSVI information

Parameters
namespaceURI:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

The namespace URI of the element to create.

qualifiedName:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

The qualified name of the element type to instantiate.

localpart:String

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

The local name of the attribute to instantiate.

Returns:Element

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

Element A new Element object with the following attributes:

Exceptions
DOMException:

Doc from org.apache.xerces.dom.CoreDocumentImpl.createElementNS.

INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

getDomConfigback to summary
public DOMConfiguration getDomConfig()

Overrides org.apache.xerces.dom.CoreDocumentImpl.getDomConfig.

Implements org.w3c.dom.Document.getDomConfig.

The configuration used when Document.normalizeDocument is invoked.

Since
DOM Level 3
getImplementationback to summary
public DOMImplementation getImplementation()

Overrides org.apache.xerces.dom.DocumentImpl.getImplementation.

Implements org.w3c.dom.Document.getImplementation.

Retrieve information describing the abilities of this particular DOM implementation. Intended to support applications that may be using DOMs retrieved from several different sources, potentially with different underlying representations.

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException

Hides org.apache.xerces.dom.CoreDocumentImpl.readObject.

Doc from org.apache.xerces.dom.CoreDocumentImpl.readObject.

The serialized forms of the user data and node table maps are Hashtables. Convert them into WeakHashMaps on load.

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Hides org.apache.xerces.dom.CoreDocumentImpl.writeObject.

Doc from org.apache.xerces.dom.CoreDocumentImpl.writeObject.

To allow DOM trees serialized by newer versions of Xerces to be read by older versions briefly move the user data and node table into Hashtables.