public class XMLDocumentBuilderFactory extends Object
DocumentBuilderFactory
class in the JDK.Modifier and Type | Method and Description |
---|---|
EntityListResolver |
getEntityListResolver()
Return the EntityListResolver which can manage entity resolution in XML files.
|
ErrorHandler |
getErrorHandler()
Return the error handler wich will be fired for parsing errors detected by the underlying parser.
|
int |
getIndentation()
Return the Document indentation.
|
URL |
getSchema()
Return the schema of the underlying parser.
|
boolean |
isKeepingAttributesOrder()
Return true if the order of attributes in the input XML structure should be preserved in the Document.
|
boolean |
isNamespaceAware()
Return true if the creation of the Document should be namespace-aware.
|
boolean |
isPreservingSpace()
Return true if spaces should be preserved when creating the Document.
|
boolean |
isShowingExceptions()
Return true if exceptions should be shown when creating the Document.
|
boolean |
isShowingWarnings()
Return true if warnings should be shown when creating the Document.
|
boolean |
isValidating()
Return true if the underlying parser is validating.
|
void |
keepAttributesOrder(boolean keepAttributesOrder)
Set if the order of attributes in the input XML structure should be preserved in the Document.
|
static XMLDocumentBuilderFactory |
newInstance()
Return a new instance.
|
Document |
parse(File file)
Create a document from a File.
|
Document |
parse(InputStream stream)
Create a document from an InputStream.
|
Document |
parse(Reader reader)
Create a document from a Reader.
|
Document |
parse(String xml)
Create a document from an XML String content.
|
Document |
parse(URL url)
Create a document from a URL.
|
Document |
parse(XMLRoot root)
Create a document from an XML tree.
|
void |
setEntityListResolver(EntityListResolver resolver)
Set the EntityListResolver which can manage entity resolution in XML files.
|
void |
setErrorHandler(ErrorHandler errorHandler)
Set an error handler wich will be fired for parsing errors detected by the underlying parser.
|
void |
setIndentation(int indentation)
Set the Document indentation.
|
void |
setNamespaceAware(boolean namespaceAware)
Set if the creation of the Document should be namespace-aware.
|
void |
setPreserveSpace(boolean preserveSpace)
Set if spaces should be preserved when creating the Document.
|
void |
setSchema(URL schema)
Set the schema of the underlying parser.
|
void |
setShowExceptions(boolean showExceptions)
Set if exceptions should be shown when creating the Document.
|
void |
setShowWarnings(boolean showWarnings)
Set if warnings should be shown when creating the Document.
|
void |
setValidating(boolean isValidating)
Set if the underlying parser is validating.
|
public static XMLDocumentBuilderFactory newInstance()
public Document parse(File file)
file
- the Filepublic Document parse(URL url)
url
- the URLpublic Document parse(InputStream stream)
stream
- the InputStreampublic Document parse(Reader reader)
reader
- the Readerpublic Document parse(String xml)
xml
- the XML String contentpublic Document parse(XMLRoot root)
root
- the root nodepublic void setEntityListResolver(EntityListResolver resolver)
resolver
- the resolverpublic EntityListResolver getEntityListResolver()
public void setErrorHandler(ErrorHandler errorHandler)
errorHandler
- the error handlerpublic ErrorHandler getErrorHandler()
public void setShowExceptions(boolean showExceptions)
showExceptions
- true if exceptions should be shown when creating the Documentpublic boolean isShowingExceptions()
public void setShowWarnings(boolean showWarnings)
showWarnings
- true if warnings should be shown when creating the Documentpublic boolean isShowingWarnings()
public void setSchema(URL schema)
schema
- the schema of the underlying parserpublic URL getSchema()
public void setValidating(boolean isValidating)
isValidating
- true if the underlying parser is validatingpublic boolean isValidating()
public void setPreserveSpace(boolean preserveSpace)
preserveSpace
- true if spaces should be preserved when creating the Documentpublic boolean isPreservingSpace()
public void setNamespaceAware(boolean namespaceAware)
namespaceAware
- true if the creation of the Document should be namespace-awarepublic boolean isNamespaceAware()
public void setIndentation(int indentation)
indentation
- the Document indentationpublic int getIndentation()
public void keepAttributesOrder(boolean keepAttributesOrder)
keepAttributesOrder
- true if the order of attributes in the input XML structure should be preserved in the Documentpublic boolean isKeepingAttributesOrder()