Class PMRDocumentBuilderFactory

java.lang.Object
javax.xml.parsers.DocumentBuilderFactory
org.episteme.natural.chemistry.loaders.cml.dom.pmr.PMRDocumentBuilderFactory

public class PMRDocumentBuilderFactory extends DocumentBuilderFactory
at present hardcoded to using default
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • PMRDocumentBuilderFactory

      public PMRDocumentBuilderFactory()
  • Method Details

    • newInstance

      public static DocumentBuilderFactory newInstance() throws FactoryConfigurationError
      Obtain a new instance of a DocumentBuilderFactory This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the DocumentBuilderFactory implementation class to load: Use the javax.xml.parsers.DocumentBuilderFactory system property. Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory in jars available to the runtime. Platform default DocumentBuilderFactory instance. Once an application has obtained a reference to a DocumentBuilderFactory it can use the factory to configure and obtain parser instances. Throws: FactoryConfigurationError - if the implementation is not available or cannot be instantiated.
      Throws:
      FactoryConfigurationError
    • newDocumentBuilder

      public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
      Creates a new instance of a DocumentBuilder using the currently configured parameters. Returns: A new instance of a DocumentBuilder. Throws: ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration requested.
      Specified by:
      newDocumentBuilder in class DocumentBuilderFactory
      Throws:
      ParserConfigurationException
    • setAttribute

      public void setAttribute(String name, Object value) throws IllegalArgumentException
      Allows the user to set specific attributes on the underlying implementation.
      Specified by:
      setAttribute in class DocumentBuilderFactory
      Parameters:
      name - The name of the attribute.
      value - The value of the attribute.
      Throws:
      IllegalArgumentException - thrown if the underlying implementation doesn't recognize the attribute.
    • getAttribute

      public Object getAttribute(String name) throws IllegalArgumentException
      Allows the user to retrieve specific attributes on the underlying implementation.
      Specified by:
      getAttribute in class DocumentBuilderFactory
      Parameters:
      name - The name of the attribute.
      Returns:
      value The value of the attribute.
      Throws:
      IllegalArgumentException - thrown if the underlying implementation doesn't recognize the attribute.
    • setFeature

      public void setFeature(String name, boolean value) throws ParserConfigurationException

      Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.

      Feature names are fully qualified URIs. Implementations may define their own features. An ParserConfigurationException is thrown if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support the feature. It is possible for an DocumentBuilderFactory to expose a feature value but be unable to change its state.

      All implementations are required to support the XMLConstants.FEATURE_SECURE_PROCESSING feature. When the feature is:

      Specified by:
      setFeature in class DocumentBuilderFactory
      Parameters:
      name - Feature name.
      value - Is feature state true or false.
      Throws:
      ParserConfigurationException - if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support this feature.
      NullPointerException - If the name parameter is null.
    • getFeature

      public boolean getFeature(String name) throws ParserConfigurationException

      Get the state of the named feature.

      Feature names are fully qualified URIs. Implementations may define their own features. An ParserConfigurationException is thrown if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support the feature. It is possible for an DocumentBuilderFactory to expose a feature value but be unable to change its state.

      Specified by:
      getFeature in class DocumentBuilderFactory
      Parameters:
      name - Feature name.
      Returns:
      State of the named feature.
      Throws:
      ParserConfigurationException - if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support this feature.