Class DOMImplementationRegistry
java.lang.Object
org.w3c.dom.bootstrap.DOMImplementationRegistry
A factory that enables applications to obtain instances of
DOMImplementation
.
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. DOM implementations may modify this class to meet new security standards or to provide *additional* fallbacks for the list of DOMImplementationSources.
- Since:
- 1.5, DOM Level 3
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Register an implementation.getDOMImplementation
(String features) Return the first implementation that has the desired features, ornull
if none is found.getDOMImplementationList
(String features) Return a list of implementations that support the desired features.static DOMImplementationRegistry
Obtain a new instance of aDOMImplementationRegistry
.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
PROPERTY
The system property to specify the DOMImplementationSource class names.- See Also:
-
-
Method Details
-
newInstance
public static DOMImplementationRegistry newInstance() throws ClassNotFoundException, InstantiationException, IllegalAccessException, ClassCastExceptionObtain a new instance of aDOMImplementationRegistry
. TheDOMImplementationRegistry
is initialized by the application or the implementation, depending on the context, by first checking the value of the Java system propertyorg.w3c.dom.DOMImplementationSourceList
and the service provider whose contents are at "META_INF/services/org.w3c.dom.DOMImplementationSourceList
". The value of this property is a white-space separated list of names of availables classes implementing theDOMImplementationSource
interface. Each class listed in the class name list is instantiated and any exceptions encountered are thrown to the application.- Returns:
- an initialized instance of DOMImplementationRegistry
- Throws:
ClassNotFoundException
- If any specified class can not be foundInstantiationException
- If any specified class is an interface or abstract classIllegalAccessException
- If the default constructor of a specified class is not accessibleClassCastException
- If any specified class does not implementDOMImplementationSource
-
getDOMImplementation
Return the first implementation that has the desired features, ornull
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 none found.
-
getDOMImplementationList
Return a list of implementations 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.
-
addSource
Register an implementation.- Parameters:
s
- The source to be registered, may not benull
-