|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.xml.parsers.DocumentBuilder
org.jdesktop.dom.SimpleDocumentBuilder
public class SimpleDocumentBuilder
A DOM DocumentBuilder implementation that does
not require the factory pattern for creation. Most of the time calling one of
the static simpleParse methods is all that is required. Occasionally
you may need to create an instance of SimpleDocumentBuilder to tweak some of the
builder settings (such as setting an ErrorHandler or EntityResolver).
| Constructor Summary | |
|---|---|
SimpleDocumentBuilder()
Create a new SimpleDocumentBuilder. |
|
SimpleDocumentBuilder(boolean namespaceAware)
|
|
SimpleDocumentBuilder(DocumentBuilderFactory factory)
Create a SimpleDocumentBuilder that will wrap builders created from the given factory. |
|
| Method Summary | |
|---|---|
DOMImplementation |
getDOMImplementation()
Obtain an instance of a DOMImplementation object. |
Schema |
getSchema()
Get a reference to the the Schema being used by
the XML processor. |
boolean |
isNamespaceAware()
Indicates whether or not this parser is configured to understand namespaces. |
boolean |
isValidating()
Indicates whether or not this parser is configured to validate XML documents. |
boolean |
isXIncludeAware()
Get the XInclude processing mode for this parser. |
SimpleDocument |
newDocument()
Obtain a new instance of a DOM Document object
to build a DOM tree with. |
SimpleDocument |
parse(File f)
Parse the content of the given file as an XML document and return a new DOM Document object. |
SimpleDocument |
parse(InputSource is)
Parse the content of the given input source as an XML document and return a new DOM Document object. |
SimpleDocument |
parse(InputStream is)
Parse the content of the given InputStream as an XML
document and return a new DOM Document object. |
SimpleDocument |
parse(InputStream is,
String systemId)
Parse the content of the given InputStream as an
XML document and return a new DOM Document object. |
SimpleDocument |
parse(String uri)
Parse the content of the given URI as an XML document and return a new DOM Document object. |
SimpleDocument |
parseString(String xml)
Parse the content of the given String as an XML document and return a new DOM SimpleDocument object. |
void |
reset()
Reset this DocumentBuilder to its original configuration. |
void |
setEntityResolver(EntityResolver er)
Specify the EntityResolver to be used to resolve
entities present in the XML document to be parsed. |
void |
setErrorHandler(ErrorHandler eh)
Specify the ErrorHandler to be used by the parser. |
static SimpleDocument |
simpleParse(InputSource is)
Parse the content of the given input source as an XML document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(InputSource is,
boolean namespaceAware)
Parse the content of the given input source as an XML document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(InputStream in)
Parse the content of the given InputStream as an XML
document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(InputStream in,
boolean namespaceAware)
Parse the content of the given InputStream as an XML
document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(String xml)
Parse the content of the given String as an XML document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(String xml,
boolean namespaceAware)
Parse the content of the given String as an XML document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(URL url)
Parse the content of the given URL as an XML document and return a new DOM SimpleDocument object. |
static SimpleDocument |
simpleParse(URL url,
boolean namespaceAware)
Parse the content of the given URL as an XML document and return a new DOM SimpleDocument object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleDocumentBuilder()
public SimpleDocumentBuilder(boolean namespaceAware)
public SimpleDocumentBuilder(DocumentBuilderFactory factory)
| Method Detail |
|---|
public SimpleDocument parseString(String xml)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
String is null.
xml - String containing the content to be parsed.
SimpleDocument result of parsing the
String
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When xml is nullDocumentHandler
public SimpleDocument parse(InputSource is)
throws SAXException,
IOException
javax.xml.parsers.DocumentBuilderDocument object.
An IllegalArgumentException is thrown if the
InputSource is null null.
parse in class DocumentBuilderis - InputSource containing the content to be parsed.
SAXException - If any parse errors occur.
IOException - If any IO errors occur.DocumentHandler
public SimpleDocument parse(InputStream is)
throws SAXException,
IOException
javax.xml.parsers.DocumentBuilderInputStream as an XML
document and return a new DOM Document object.
An IllegalArgumentException is thrown if the
InputStream is null.
parse in class DocumentBuilderis - InputStream containing the content to be parsed.
Document result of parsing the
InputStream
SAXException - If any parse errors occur.
IOException - If any IO errors occur.DocumentHandler
public SimpleDocument parse(InputStream is,
String systemId)
throws SAXException,
IOException
javax.xml.parsers.DocumentBuilderInputStream as an
XML document and return a new DOM Document object.
An IllegalArgumentException is thrown if the
InputStream is null.
parse in class DocumentBuilderis - InputStream containing the content to be parsed.systemId - Provide a base for resolving relative URIs.
SAXException - If any parse errors occur.
IOException - If any IO errors occur.DocumentHandler
public SimpleDocument parse(String uri)
throws SAXException,
IOException
javax.xml.parsers.DocumentBuilderDocument object.
An IllegalArgumentException is thrown if the
URI is null null.
parse in class DocumentBuilderuri - The location of the content to be parsed.
SAXException - If any parse errors occur.
IOException - If any IO errors occur.DocumentHandler
public SimpleDocument parse(File f)
throws SAXException,
IOException
javax.xml.parsers.DocumentBuilderDocument object.
An IllegalArgumentException is thrown if the
File is null null.
parse in class DocumentBuilderf - The file containing the XML to parse.
SAXException - If any parse errors occur.
IOException - If any IO errors occur.DocumentHandlerpublic boolean isNamespaceAware()
javax.xml.parsers.DocumentBuilder
isNamespaceAware in class DocumentBuilderpublic boolean isValidating()
javax.xml.parsers.DocumentBuilder
isValidating in class DocumentBuilderpublic void setEntityResolver(EntityResolver er)
javax.xml.parsers.DocumentBuilderEntityResolver to be used to resolve
entities present in the XML document to be parsed. Setting
this to null will result in the underlying
implementation using it's own default implementation and
behavior.
setEntityResolver in class DocumentBuilderer - The EntityResolver to be used to resolve entities
present in the XML document to be parsed.public void setErrorHandler(ErrorHandler eh)
javax.xml.parsers.DocumentBuilderErrorHandler to be used by the parser.
Setting this to null will result in the underlying
implementation using it's own default implementation and
behavior.
setErrorHandler in class DocumentBuildereh - The ErrorHandler to be used by the parser.public SimpleDocument newDocument()
javax.xml.parsers.DocumentBuilderDocument object
to build a DOM tree with.
newDocument in class DocumentBuilderpublic DOMImplementation getDOMImplementation()
javax.xml.parsers.DocumentBuilderDOMImplementation object.
getDOMImplementation in class DocumentBuilderDOMImplementation.public void reset()
javax.xml.parsers.DocumentBuilderReset this DocumentBuilder to its original configuration.
DocumentBuilder is reset to the same state as when it was created with
DocumentBuilderFactory.newDocumentBuilder().
reset() is designed to allow the reuse of existing DocumentBuilders
thus saving resources associated with the creation of new DocumentBuilders.
The reset DocumentBuilder is not guaranteed to have the same EntityResolver or ErrorHandler
Objects, e.g. Object.equals(Object obj). It is guaranteed to have a functionally equal
EntityResolver and ErrorHandler.
reset in class DocumentBuilderpublic Schema getSchema()
javax.xml.parsers.DocumentBuilderGet a reference to the the Schema being used by
the XML processor.
If no schema is being used, null is returned.
getSchema in class DocumentBuilderSchema being used or null
if none in usepublic boolean isXIncludeAware()
javax.xml.parsers.DocumentBuilderGet the XInclude processing mode for this parser.
isXIncludeAware in class DocumentBuilderDocumentBuilderFactory.isXIncludeAware()
when this parser was created from factory.DocumentBuilderFactory.setXIncludeAware(boolean)
public static SimpleDocument simpleParse(InputSource is)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
InputSource is null null.
is - InputSource containing the content to be parsed.
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When is is nullDocumentHandler
public static SimpleDocument simpleParse(InputStream in)
throws SAXException,
IOException
InputStream as an XML
document and return a new DOM SimpleDocument object.
An IllegalArgumentException is thrown if the
InputStream is null.
is - InputStream containing the content to be parsed.
SimpleDocument result of parsing the
InputStream
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When is is nullDocumentHandler
public static SimpleDocument simpleParse(URL url)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
URI is null null.
uri - The location of the content to be parsed.
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When url is nullDocumentHandler
public static SimpleDocument simpleParse(String xml)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
String is null.
xml - String containing the content to be parsed.
SimpleDocument result of parsing the
String
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When xml is nullDocumentHandler
public static SimpleDocument simpleParse(InputSource is,
boolean namespaceAware)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
InputSource is null null.
is - InputSource containing the content to be parsed.namespaceAware - whether the parser should be namespace aware
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When is is nullDocumentHandler
public static SimpleDocument simpleParse(InputStream in,
boolean namespaceAware)
throws SAXException,
IOException
InputStream as an XML
document and return a new DOM SimpleDocument object.
An IllegalArgumentException is thrown if the
InputStream is null.
in - InputStream containing the content to be parsed.namespaceAware - whether the parser should be namespace aware
SimpleDocument result of parsing the
InputStream
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When is is nullDocumentHandler
public static SimpleDocument simpleParse(URL url,
boolean namespaceAware)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
URI is null null.
url - The location of the content to be parsed.namespaceAware - whether the parser should be namespace aware
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When url is nullDocumentHandler
public static SimpleDocument simpleParse(String xml,
boolean namespaceAware)
throws SAXException,
IOException
SimpleDocument object.
An IllegalArgumentException is thrown if the
String is null.
xml - String containing the content to be parsed.namespaceAware - whether the parser should be namespace aware
SimpleDocument result of parsing the
String
IOException - If any IO errors occur.
SAXException - If any parse errors occur.
IllegalArgumentException - When xml is nullDocumentHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||