|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.xml.parsers.DocumentBuilderFactory
Responsible for creating new DOM parsers
Normally, users will create a DOM parser as follows:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document doc = parser.parse(myInputSource);
DocumentBuilderFactory uses the system property javax.xml.parsers.XmlDocumentParserFactory to find the class to load. So you can change the parser by calling:
System.setProperty("javax.xml.parsers.XmlDocumentParserFactory",
"com.foo.myFactory");
Constructor Summary | |
DocumentBuilderFactory()
|
Method Summary | |
abstract java.lang.Object |
getAttribute(java.lang.String name)
Returns an implementation-specific attributes. |
boolean |
isCoalescing()
Returns true if the returned DocumentBuilder will combine Text and CDATA nodes into single text nodes. |
boolean |
isExpandEntityReferences()
Returns true if the returned parser will expand entity reference nodes. |
boolean |
isIgnoringComments()
Returns true if the parser will ignore comments. |
boolean |
isIgnoringElementContentWhitespace()
Returns true if the parser will ignore ignorable-whitespace |
boolean |
isNamespaceAware()
Returns true if the parser is namespace-aware |
boolean |
isValidating()
Returns true if the parser is validating |
abstract DocumentBuilder |
newDocumentBuilder()
Creates a new DocumentBuilder() |
static DocumentBuilderFactory |
newInstance()
Returns a new DocumentBuilderFactory instance based on the javax.xml.parsers.DocumentBuilderFactory system property. |
abstract void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an implementation-specific attributes. |
void |
setCoalescing(boolean isCoalescing)
Sets true if the returned DocumentBuilder should combine Text and CDATA nodes into single text nodes. |
void |
setExpandEntityReferences(boolean expand)
Set true if the returned parser should expand entity reference nodes. |
void |
setIgnoringComments(boolean ignore)
Set true if the parser should ignore comments |
void |
setIgnoringElementContentWhitespace(boolean ignore)
Set true if the parser should ignore ignorable-whitespace |
void |
setNamespaceAware(boolean namespaceAware)
Set true if the parser should be namespace-aware |
void |
setValidating(boolean validating)
Set true if the parser should be validating-aware |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DocumentBuilderFactory()
Method Detail |
public abstract java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the name of the attributepublic abstract void setAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
name
- the name of the attributevalue
- the value of the attributepublic boolean isCoalescing()
public void setCoalescing(boolean isCoalescing)
public boolean isExpandEntityReferences()
public void setExpandEntityReferences(boolean expand)
public boolean isIgnoringComments()
public void setIgnoringComments(boolean ignore)
public boolean isIgnoringElementContentWhitespace()
public void setIgnoringElementContentWhitespace(boolean ignore)
public boolean isNamespaceAware()
public void setNamespaceAware(boolean namespaceAware)
public boolean isValidating()
public void setValidating(boolean validating)
public static DocumentBuilderFactory newInstance() throws FactoryConfigurationError
public abstract DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |