Class DocumentBuilderFactoryImpl
public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory
-
Constructor Summary
Constructors Constructor Description DocumentBuilderFactoryImpl() -
Method Summary
Modifier and Type Method Description ObjectgetAttribute(String name)Allows the user to retrieve specific attributes on the underlying implementation.booleangetFeature(String name)Get the state of the named feature.DocumentBuildernewDocumentBuilder()Creates a new instance of aDocumentBuilderusing the currently configured parameters.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 javax.xml.parsers.DocumentBuilderFactory
getSchema, isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, isXIncludeAware, newInstance, newInstance, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setSchema, setValidating, setXIncludeAware
-
Constructor Details
-
DocumentBuilderFactoryImpl
public DocumentBuilderFactoryImpl()
-
-
Method Details
-
getAttribute
Description copied from class:DocumentBuilderFactoryAllows 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.
-
getFeature
Description copied from class:DocumentBuilderFactoryGet the state of the named feature.
Feature names are fully qualified
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.- 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.
-
newDocumentBuilder
Description copied from class:DocumentBuilderFactoryCreates a new instance of aDocumentBuilderusing the currently configured parameters.- Specified by:
newDocumentBuilderin classDocumentBuilderFactory- Returns:
- A new instance of a DocumentBuilder.
- Throws:
ParserConfigurationException- if a DocumentBuilder cannot be created which satisfies the configuration requested.
-
setAttribute
Description copied from class:DocumentBuilderFactoryAllows 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.
-
setFeature
Description copied from class:DocumentBuilderFactorySet a feature for this
DocumentBuilderFactoryandDocumentBuilders created by this factory.Feature names are fully qualified
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 the
XMLConstants.FEATURE_SECURE_PROCESSINGfeature. When the feature is:-
true: the implementation will limit XML processing to conform to implementation limits. Examples include entity 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(SAXParseException exception). SeeDocumentBuilder.setErrorHandler(org.xml.sax.ErrorHandler errorHandler). -
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.
-
-