org.jscience.ml.cml.dom.pmr
Class PMRDocumentBuilderFactory

java.lang.Object
  extended by javax.xml.parsers.DocumentBuilderFactory
      extended by org.jscience.ml.cml.dom.pmr.PMRDocumentBuilderFactory

public class PMRDocumentBuilderFactory
extends javax.xml.parsers.DocumentBuilderFactory

at present hardcoded to using default


Constructor Summary
PMRDocumentBuilderFactory()
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Allows the user to retrieve specific attributes on the underlying implementation.
 boolean getFeature(java.lang.String name)
          Get the state of the named feature.
 javax.xml.parsers.DocumentBuilder newDocumentBuilder()
          Creates a new instance of a DocumentBuilder using the currently configured parameters.
static javax.xml.parsers.DocumentBuilderFactory newInstance()
          Obtain a new instance of a DocumentBuilderFactory This static method creates a new factory instance.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Allows the user to set specific attributes on the underlying implementation.
 void setFeature(java.lang.String name, boolean value)
          Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.
 
Methods inherited from class javax.xml.parsers.DocumentBuilderFactory
getSchema, isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, isXIncludeAware, newInstance, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setSchema, setValidating, setXIncludeAware
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMRDocumentBuilderFactory

public PMRDocumentBuilderFactory()
Method Detail

newInstance

public static javax.xml.parsers.DocumentBuilderFactory newInstance()
                                                            throws javax.xml.parsers.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:
javax.xml.parsers.FactoryConfigurationError

newDocumentBuilder

public javax.xml.parsers.DocumentBuilder newDocumentBuilder()
                                                     throws javax.xml.parsers.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 javax.xml.parsers.DocumentBuilderFactory
Throws:
javax.xml.parsers.ParserConfigurationException

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
                  throws java.lang.IllegalArgumentException
Allows the user to set specific attributes on the underlying implementation.

Specified by:
setAttribute in class javax.xml.parsers.DocumentBuilderFactory
Parameters:
name - The name of the attribute.
value - The value of the attribute.
Throws:
java.lang.IllegalArgumentException - thrown if the underlying implementation doesn't recognize the attribute.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
                              throws java.lang.IllegalArgumentException
Allows the user to retrieve specific attributes on the underlying implementation.

Specified by:
getAttribute in class javax.xml.parsers.DocumentBuilderFactory
Parameters:
name - The name of the attribute.
Returns:
value The value of the attribute.
Throws:
java.lang.IllegalArgumentException - thrown if the underlying implementation doesn't recognize the attribute.

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws javax.xml.parsers.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 javax.xml.parsers.DocumentBuilderFactory
Parameters:
name - Feature name.
value - Is feature state true or false.
Throws:
javax.xml.parsers.ParserConfigurationException - if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support this feature.
java.lang.NullPointerException - If the name parameter is null.

getFeature

public boolean getFeature(java.lang.String name)
                   throws javax.xml.parsers.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 javax.xml.parsers.DocumentBuilderFactory
Parameters:
name - Feature name.
Returns:
State of the named feature.
Throws:
javax.xml.parsers.ParserConfigurationException - if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support this feature.