org.apache.xerces.dom3.bootstrap

Class DOMImplementationRegistry


public class DOMImplementationRegistry
extends java.lang.Object

This class holds the list of registered DOMImplementations. The contents of the registry are drawn from the System Property org.w3c.dom.DOMImplementationSourceList, which must contain a white-space delimited sequence of the names of classes implementing DOMImplementationSource. Applications may also register DOMImplementationSource implementations by using a method on this class. They may then query instances of the registry for implementations supporting specific features.

Example:

 // get an instance of the DOMImplementation registry
 DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
 // get a DOM implementation the Level 3 XML module
 DOMImplementation domImpl = registry.getDOMImplementation("XML 3.0");
 

This provides an application with an implementation-independent starting point.

Since:
DOM Level 3
See Also:
DOMImplementation, DOMImplementationSource

Field Summary

static String
PROPERTY

Method Summary

void
addSource(DOMImplementationSource s)
Register an implementation.
DOMImplementation
getDOMImplementation(String features)
Return the first registered implementation that has the desired features, or null if none is found.
DOMImplementationList
getDOMImplementationList(String features)
Return the list of all registered implementation that support the desired features.
static DOMImplementationRegistry
newInstance()

Field Details

PROPERTY

public static final String PROPERTY

Method Details

addSource

public void addSource(DOMImplementationSource s)
            throws ClassNotFoundException,
                   InstantiationException,
                   IllegalAccessException
Register an implementation.

getDOMImplementation

public DOMImplementation getDOMImplementation(String features)
            throws ClassNotFoundException,
                   InstantiationException,
                   IllegalAccessException,
                   ClassCastException
Return the first registered implementation that has the desired features, or null if none is found.
Parameters:
features - A string that specifies which features are required. This is a space separated list in which each feature is specified by its name optionally followed by a space and a version number. This is something like: "XML 1.0 Traversal +Events 2.0"
Returns:
An implementation that has the desired features, or null if this source has none.

getDOMImplementationList

public DOMImplementationList getDOMImplementationList(String features)
            throws ClassNotFoundException,
                   InstantiationException,
                   IllegalAccessException,
                   ClassCastException
Return the list of all registered implementation that support the desired features.
Parameters:
features - A string that specifies which features are required. This is a space separated list in which each feature is specified by its name optionally followed by a space and a version number. This is something like: "XML 1.0 Traversal +Events 2.0"
Returns:
A list of DOMImplementations that support the desired features.

newInstance

public static DOMImplementationRegistry newInstance()
            throws ClassNotFoundException,
                   InstantiationException,
                   IllegalAccessException

Copyright © 1999-2004 Apache XML Project. All Rights Reserved.