public abstract class DocumentBuilderFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Object |
getAttribute(java.lang.String name)
Allows the user to retrieve specific attributes on the underlying
implementation.
|
boolean |
isCoalescing()
Indicates whether or not the factory is configured to produce
parsers which converts CDATA nodes to Text nodes and appends it to
the adjacent (if any) Text node.
|
boolean |
isExpandEntityReferences()
Indicates whether or not the factory is configured to produce
parsers which expand entity reference nodes.
|
boolean |
isIgnoringComments()
Indicates whether or not the factory is configured to produce
parsers which ignores comments.
|
boolean |
isIgnoringElementContentWhitespace()
Indicates whether or not the factory is configured to produce
parsers which ignore ignorable whitespace in element content.
|
boolean |
isNamespaceAware()
Indicates whether or not the factory is configured to produce
parsers which are namespace aware.
|
boolean |
isValidating()
Indicates whether or not the factory is configured to produce
parsers which validate the XML content during parse.
|
abstract DocumentBuilder |
newDocumentBuilder()
Creates a new instance of a DocumentBuilder using the
currently configured parameters.
|
static DocumentBuilderFactory |
newInstance()
Obtain a new instance of a
DocumentBuilderFactory . |
abstract void |
setAttribute(java.lang.String name,
java.lang.Object value)
Allows the user to set specific attributes on the underlying
implementation.
|
void |
setCoalescing(boolean coalescing)
Specifies that the parser produced by this code will
convert CDATA nodes to Text nodes and append it to the
adjacent (if any) text node.
|
void |
setExpandEntityReferences(boolean expandEntityRef)
Specifies that the parser produced by this code will
expand entity reference nodes.
|
void |
setIgnoringComments(boolean ignoreComments)
Specifies that the parser produced by this code will
ignore comments.
|
void |
setIgnoringElementContentWhitespace(boolean whitespace)
Specifies that the parsers created by this factory must eliminate
whitespace in element content (sometimes known loosely as
'ignorable whitespace') when parsing XML documents (see XML Rec
2.10).
|
void |
setNamespaceAware(boolean awareness)
Specifies that the parser produced by this code will
provide support for XML namespaces.
|
void |
setValidating(boolean validating)
Specifies that the parser produced by this code will
validate documents as they are parsed.
|
public static DocumentBuilderFactory newInstance()
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:
javax.xml.parsers.DocumentBuilderFactory
system
property.
META-INF/services/javax.xml.parsers.DocumentBuilderFactory
in jars available to the runtime.
DocumentBuilderFactory
instance.
DocumentBuilderFactory
it can use the factory to
configure and obtain parser instances.FactoryConfigurationError
- if the implementation is not
available or cannot be instantiated.public abstract DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
ParserConfigurationException
- if a DocumentBuilder
cannot be created which satisfies the configuration requestedpublic void setNamespaceAware(boolean awareness)
false
public void setValidating(boolean validating)
false
public void setIgnoringElementContentWhitespace(boolean whitespace)
false
public void setExpandEntityReferences(boolean expandEntityRef)
true
public void setIgnoringComments(boolean ignoreComments)
false
public void setCoalescing(boolean coalescing)
false
public boolean isNamespaceAware()
public boolean isValidating()
public boolean isIgnoringElementContentWhitespace()
public boolean isExpandEntityReferences()
public boolean isIgnoringComments()
public boolean isCoalescing()
public abstract void setAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
name
- The name of the attribute.value
- The value of the attribute.java.lang.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public abstract java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
name
- The name of the attribute.java.lang.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.Copyright © 2020, 2024, Oracle and/or its affiliates.