javax.xml.parsers
public
abstract
class
javax.xml.parsers.DocumentBuilderFactory
Provides a factory for DocumentBuilder instances. The class first needs to be
instantiated using the newInstance() method. The instance can be configured
as desired. A call to newDocumentBuilder () then provides a DocumentBuilder
instance matching this configuration (if possible).
Summary
Protected Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Protected Constructors
protected
DocumentBuilderFactory()
Do-nothing constructor. To be overridden by concrete document builders.
Public Methods
public
abstract
Object
getAttribute(String name)
Queries an attribute from the underlying implementation.
Parameters
name
| The name of the attribute. |
Returns
- The value of the attribute.
public
abstract
boolean
getFeature(String name)
Queries a feature from the underlying implementation.
Parameters
name
| The name of the feature. The default Android implementation
of DocumentBuilder supports only the following two features:
http://xml.org/sax/features/namespaces
- Queries the state of namespace-awareness.
http://xml.org/sax/features/namespaces
- Queries the state of validation.
Note that despite the ability to query the validation
feature, there is currently no validating parser available. |
Returns
- The status of the feature.
public
boolean
isCoalescing()
Queries whether the factory is configured to deliver parsers that convert
CDATA nodes to text nodes and melt them with neighbouring nodes.
Returns
- true if coalescing is desired, false otherwise.
public
boolean
isExpandEntityReferences()
Queries whether the factory is configured to deliver parsers that expand
entity references.
Returns
- true if entity expansion is desired, false otherwise.
public
boolean
isIgnoringComments()
Queries whether the factory is configured to deliver parsers that ignore
comments.
Returns
- true if comment ignorance is desired, false otherwise.
public
boolean
isIgnoringElementContentWhitespace()
Queries whether the factory is configured to deliver parsers that ignore
whitespace in elements.
Returns
- true if whitespace ignorance is desired, false otherwise.
public
boolean
isNamespaceAware()
Queries whether the factory is configured to deliver parsers that are
namespace-aware.
Returns
- true if namespace-awareness is desired, false otherwise.
public
boolean
isValidating()
Queries whether the factory is configured to deliver parsers that are
validating.
Returns
- true if validating is desired, false otherwise.
public
boolean
isXIncludeAware()
Queries whether the factory is configured to deliver parsers that are
XInclude-aware.
Returns
- true if XInclude-awareness is desired, false otherwise.
public
abstract
DocumentBuilder
newDocumentBuilder()
Creates a new DocumentBuilder that matches the current configuration.
Creates a new DocumentBuilderFactory that can be configured and then be
used for creating DocumentBuilder objects.
Returns
- The DocumentBuilderFactory.
public
abstract
void
setAttribute(String name, Object value)
Sets an attribute in the underlying implementation.
Parameters
name
| The name of the attribute. |
value
| The value of the attribute. |
public
void
setCoalescing(boolean value)
Determines whether the factory is configured to deliver parsers that
convert CDATA nodes to text nodes and melt them with neighbouring nodes.
Parameters
value
| Turns coalescing on or off.
|
public
void
setExpandEntityReferences(boolean value)
Determines whether the factory is configured to deliver parsers that
expands entity references.
Parameters
value
| Turns entity reference expansion on or off.
|
public
abstract
void
setFeature(String name, boolean value)
Sets a feature in the underlying implementation.
Parameters
name
| The name of the feature. The default Android implementation
of DocumentBuilder supports only the following two features:
http://xml.org/sax/features/namespaces
- Turns namespace-awareness on or off.
http://xml.org/sax/features/namespaces
- Turns validation on or off.
Note that despite the ability to set the validation feature,
there is currently no validating parser available. |
value
| The value of the feature. |
public
void
setIgnoringComments(boolean value)
Determines whether the factory is configured to deliver parsers that
ignore comments.
Parameters
value
| Turns comment ignorance on or off.
|
public
void
setIgnoringElementContentWhitespace(boolean value)
Determines whether the factory is configured to deliver parsers that
ignores element whitespace.
Parameters
value
| Turns element whitespace ignorance on or off.
|
public
void
setNamespaceAware(boolean value)
Determines whether the factory is configured to deliver parsers that are
namespace-aware.
Parameters
value
| Turns namespace-awareness on or off.
|
public
void
setValidating(boolean value)
Determines whether the factory is configured to deliver parsers that are
validating.
Parameters
value
| Turns validation on or off.
|
public
void
setXIncludeAware(boolean value)
Determines whether the factory is configured to deliver parsers that are
XInclude-aware.
Parameters
value
| Turns XInclude-awareness on or off.
|