uk.ac.starlink.hdx
Class HdxDOMImplementation

java.lang.Object
  extended by uk.ac.starlink.hdx.HdxDOMImplementation
All Implemented Interfaces:
DOMImplementation

public class HdxDOMImplementation
extends Object
implements DOMImplementation

Provides methods for performing operations that are independent of any particular instance of the document object model.

Note that only DOM Level 2 methods are currently implemented. If this class is built using JDK1.5, then the DOM Level 3 methods will be present, but they do not implement the functionality defined by the DOM Level 3 specification (mostly they throw NOT_SUPPORTED_ERR type DOMExceptions).


Method Summary
 Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype)
          Creates a DOM Document object of the specified type with its document element.
 DocumentType createDocumentType(String qualifiedName, String publicId, String systemId)
          Does not create an empty DocumentType node.
 Object getFeature(String feature, String version)
          Get the implementation of a specific feature.
static HdxDOMImplementation getInstance()
           
 boolean hasFeature(String feature, String version)
          Test if the DOM implementation implements a specific feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static HdxDOMImplementation getInstance()

hasFeature

public boolean hasFeature(String feature,
                          String version)
Test if the DOM implementation implements a specific feature.

At present, this implementation does not claim conformance with any modules in the DOM specification (see section Conformance in the DOM2 specification). It is likely largely conformant with the Core module at least, but this has not been checked.

Specified by:
hasFeature in interface DOMImplementation
Parameters:
feature - the name of the feature to test
version - this is the version number of the feature to test
Returns:
false in all cases

getFeature

public Object getFeature(String feature,
                         String version)
Get the implementation of a specific feature.

At present there are none of these. See hasFeature(java.lang.String, java.lang.String).

Specified by:
getFeature in interface DOMImplementation
Parameters:
feature - the name of the feature to test
version - this is the version number of the feature to test
Returns:
null for all cases

createDocumentType

public DocumentType createDocumentType(String qualifiedName,
                                       String publicId,
                                       String systemId)
                                throws DOMException
Does not create an empty DocumentType node. This method is not implemented, and always throws an exception.

Specified by:
createDocumentType in interface DOMImplementation
Throws:
DOMException - NOT_SUPPORTED_ERR: in all cases.

createDocument

public Document createDocument(String namespaceURI,
                               String qualifiedName,
                               DocumentType doctype)
                        throws DOMException
Creates a DOM Document object of the specified type with its document element.

The parameters and exceptions documented below are copied from the DOMImplementation documentation. However, the current implementation of this method does not implement the namespaceURI and doctype parameters. For future compatibility, both these parameters should be null, and parameter qualifiedName should be the (unqualified) name of the document element, though this is not currently checked.

Specified by:
createDocument in interface DOMImplementation
Parameters:
namespaceURI - the namespace URI of the document element to create
qualifiedName - the qualified name of the document element to be created
doctype - the type of document to be created or null. When doctype is not null, its Node.ownerDocument attribute is set to the document being created.
Returns:
a new Document object
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
DOMException - 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 , or if the DOM implementation does not support the "XML" feature but a non-null namespace URI was provided, since namespaces were defined by XML.
DOMException - WRONG_DOCUMENT_ERR: Raised if doctype has already been used with a different document or was created from a different implementation.
NOT_SUPPORTED_ERR: - May be raised by DOM implementations which do not support the "XML" feature, if they choose not to support this method. Other features introduced in the future, by the DOM WG or in extensions defined by other groups, may also demand support for this method; please consult the definition of the feature to see if it requires this method


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.