Class PMRDocumentBuilderFactory
java.lang.Object
javax.xml.parsers.DocumentBuilderFactory
org.episteme.natural.chemistry.loaders.cml.dom.pmr.PMRDocumentBuilderFactory
at present hardcoded to using default
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Allows the user to retrieve specific attributes on the underlying implementation.booleangetFeature(String name) Get the state of the named feature.Creates a new instance of a DocumentBuilder using the currently configured parameters.static DocumentBuilderFactoryObtain a new instance of a DocumentBuilderFactory This static method creates a new factory instance.voidsetAttribute(String name, Object value) Allows the user to set specific attributes on the underlying implementation.voidsetFeature(String name, boolean value) Set a feature for thisDocumentBuilderFactoryandDocumentBuilders created by this factory.Methods inherited from class DocumentBuilderFactory
getSchema, isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, isXIncludeAware, newDefaultInstance, newDefaultNSInstance, newInstance, newNSInstance, newNSInstance, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setSchema, setValidating, setXIncludeAware
-
Constructor Details
-
PMRDocumentBuilderFactory
public PMRDocumentBuilderFactory()
-
-
Method Details
-
newInstance
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
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:
newDocumentBuilderin classDocumentBuilderFactory- Throws:
ParserConfigurationException
-
setAttribute
Allows the user to set specific attributes on the underlying implementation.- Specified by:
setAttributein classDocumentBuilderFactory- 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
Allows the user to retrieve specific attributes on the underlying implementation.- Specified by:
getAttributein classDocumentBuilderFactory- 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
Set a feature for this
Feature names are fully qualifiedDocumentBuilderFactoryandDocumentBuilders created by this factory.URIs. Implementations may define their own features. AnParserConfigurationExceptionis thrown if thisDocumentBuilderFactoryor theDocumentBuilders it creates cannot support the feature. It is possible for anDocumentBuilderFactoryto expose a feature value but be unable to change its state. All implementations are required to support theXMLConstants.FEATURE_SECURE_PROCESSINGfeature. When the feature is:-
true: the implementation will limit XML processing to conform to implementation limits. Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources. If XML processing is limited for security reasons, it will be reported via a call to the registeredErrorHandler.fatalError(SAXParseExceptionexception). SeeDocumentBuilder.setErrorHandler(org.xml.sax.ErrorHandlererrorHandler). -
false: the implementation will processing XML according to the XML specifications without regard to possible implementation limits.
- Specified by:
setFeaturein classDocumentBuilderFactory- Parameters:
name- Feature name.value- Is feature statetrueorfalse.- Throws:
ParserConfigurationException- if thisDocumentBuilderFactoryor theDocumentBuilders it creates cannot support this feature.NullPointerException- If thenameparameter is null.
-
-
getFeature
Get the state of the named feature.
Feature names are fully qualifiedURIs. Implementations may define their own features. AnParserConfigurationExceptionis thrown if thisDocumentBuilderFactoryor theDocumentBuilders it creates cannot support the feature. It is possible for anDocumentBuilderFactoryto expose a feature value but be unable to change its state.- Specified by:
getFeaturein classDocumentBuilderFactory- Parameters:
name- Feature name.- Returns:
- State of the named feature.
- Throws:
ParserConfigurationException- if thisDocumentBuilderFactoryor theDocumentBuilders it creates cannot support this feature.
-