Class DOMImplementationRegistry

java.lang.Object
org.w3c.dom.bootstrap.DOMImplementationRegistry

public final class DOMImplementationRegistry extends Object
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
    Modifier and Type
    Field
    Description
    static final String
    The system property to specify the DOMImplementationSource class names.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Register an implementation.
    Return the first implementation that has the desired features, or null if none is found.
    Return a list of implementations that support the desired features.
    Obtain a new instance of a DOMImplementationRegistry.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Field Details

    • PROPERTY

      public static final String PROPERTY
      The system property to specify the DOMImplementationSource class names.
      See Also:
  • Method Details

    • newInstance

      Obtain a new instance of a DOMImplementationRegistry. The DOMImplementationRegistry is initialized by the application or the implementation, depending on the context, by first checking the value of the Java system property org.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 the DOMImplementationSource 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 found
      InstantiationException - If any specified class is an interface or abstract class
      IllegalAccessException - If the default constructor of a specified class is not accessible
      ClassCastException - If any specified class does not implement DOMImplementationSource
    • getDOMImplementation

      public DOMImplementation getDOMImplementation(String features)
      Return the first 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 none found.
    • getDOMImplementationList

      public DOMImplementationList getDOMImplementationList(String features)
      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

      public void addSource(DOMImplementationSource s)
      Register an implementation.
      Parameters:
      s - The source to be registered, may not be null