Object
Static factory class for creating new instances. Note that if a type can be inferred from the XML being loaded (for example, by recognizing the document element QName), then the instance returned by a factory will have the inferred type. Otherwise the Factory will returned an untyped document.
Object
XmlObject.Factory
XmlObject
Method Summary |
public static |
|
public static |
|
public static |
|
public static |
|
public static | |
public static |
|
public static |
|
public static | |
public static |
|
public static | |
public static |
|
public static | |
public static |
|
public static |
|
public static |
|
public static | |
public static |
|
public static | |
public static |
|
public static |
|
public static |
|
Methods from class java.lang. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static XmlObject newInstance()
Creates a new, completely empty instance.
public staticXmlObjectnewInstance(XmlOptionsoptions)
Creates a new, completely empty instance, specifying options for the root element's document type and/or whether to validate value facets as they are set.
Use the options parameter to specify the following:| To specify this | Use this method |
|---|---|
| The document type for the root element. | XmlOptions.setDocumentType(SchemaType) |
| Whether value facets should be checked as they are set. | XmlOptions.setValidateOnSet() |
DEPRECATED Superceded by JSR 173
public staticReturns a new validatingXMLInputStreamnewValidatingXMLInputStream(XMLInputStreamxis)
throwsXmlException,XMLStreamException
XMLInputStream that throws exceptions when the input is not valid.
XmlException
XMLStreamException
DEPRECATED Superceded by JSR 173
public staticReturns a new validatingXMLInputStreamnewValidatingXMLInputStream(XMLInputStreamxis,XmlOptionsoptions)
throwsXmlException,XMLStreamException
XMLInputStream that throws exceptions
when the input is not valid, specifying options
for the root element's document type and/or the collection object to use
as an error listener while validating.
Use the options parameter to specify the following:
XmlOptions.setErrorListener(Collection).XmlOptions.setDocumentType(SchemaType).XmlException
XMLStreamException
public staticCreates an immutableXmlObjectnewValue(Objectobj)
XmlObject value
public static XmlSaxHandler newXmlSaxHandler()
Returns an XmlSaxHandler that can load an XmlObject from SAX events.
public staticReturns anXmlSaxHandlernewXmlSaxHandler(XmlOptionsoptions)
XmlSaxHandler that can load an XmlObject from SAX events.
public staticParses the givenXmlObjectparse(Strings)
throwsXmlException
String as XML.
XmlException
public staticParses the givenXmlObjectparse(Strings,XmlOptionsoptions)
throwsXmlException
String as XML.
Use the options parameter to specify the following:
| To specify this | Use this method |
|---|---|
| The document type for the root element. | XmlOptions.setDocumentType(SchemaType) |
| To place line number annotations in the store when parsing a document. | XmlOptions.setLoadLineNumbers() |
| To replace the document element with the specified QName when parsing. | XmlOptions.setLoadReplaceDocumentElement(QName) |
| To strip all insignificant whitespace when parsing a document. | XmlOptions.setLoadStripWhitespace() |
| To strip all comments when parsing a document. | XmlOptions.setLoadStripComments() |
| To strip all processing instructions when parsing a document. | XmlOptions.setLoadStripProcinsts() |
| A map of namespace URI substitutions to use when parsing a document. | XmlOptions.setLoadSubstituteNamespaces(Map) |
| Additional namespace mappings to be added when parsing a document. | XmlOptions.setLoadAdditionalNamespaces(Map) |
| To trim the underlying XML text buffer immediately after parsing a document, resulting in a smaller memory footprint. | XmlOptions.setLoadTrimTextBuffer() |
XmlException
public staticParses the givenXmlObjectparse(Filef)
throwsXmlException,IOException
File as XML.
XmlException
IOException
public staticParses the givenXmlObjectparse(Filef,XmlOptionsoptions)
throwsXmlException,IOException
File as XML.
XmlException
IOException
public staticDownloads the givenXmlObjectparse(URLu)
throwsXmlException,IOException
URL as XML.
XmlException
IOException
public staticDownloads the givenXmlObjectparse(URLu,XmlOptionsoptions)
throwsXmlException,IOException
URL as XML.
XmlException
IOException
public staticDecodes and parses the givenXmlObjectparse(InputStreamis)
throwsXmlException,IOException
InputStream as XML.
XmlException
IOException
public staticDecodes and parses the givenXmlObjectparse(InputStreamis,XmlOptionsoptions)
throwsXmlException,IOException
InputStream as XML.
Use the options parameter to specify the following:
| To specify this | Use this method |
|---|---|
| The character encoding to use when parsing or writing a document. | XmlOptions.setCharacterEncoding(String) |
| The document type for the root element. | XmlOptions.setDocumentType(SchemaType) |
| Place line number annotations in the store when parsing a document. | XmlOptions.setLoadLineNumbers() |
| Replace the document element with the specified QName when parsing. | XmlOptions.setLoadReplaceDocumentElement(QName) |
| Strip all insignificant whitespace when parsing a document. | XmlOptions.setLoadStripWhitespace() |
| Strip all comments when parsing a document. | XmlOptions.setLoadStripComments() |
| Strip all processing instructions when parsing a document. | XmlOptions.setLoadStripProcinsts() |
| Set a map of namespace URI substitutions to use when parsing a document. | XmlOptions.setLoadSubstituteNamespaces(Map) |
| Set additional namespace mappings to be added when parsing a document. | XmlOptions.setLoadAdditionalNamespaces(Map) |
| Trim the underlying XML text buffer immediately after parsing a document, resulting in a smaller memory footprint. | XmlOptions.setLoadTrimTextBuffer() |
XmlException
IOException
public staticParses the givenXmlObjectparse(Readerr)
throwsXmlException,IOException
Reader as XML.
XmlException
IOException
public staticParses the givenXmlObjectparse(Readerr,XmlOptionsoptions)
throwsXmlException,IOException
Reader as XML.
XmlException
IOException
public staticConverts the given DOMXmlObjectparse(Nodenode)
throwsXmlException
Node into an XmlObject.
XmlException
public staticConverts the given DOMXmlObjectparse(Nodenode,XmlOptionsoptions)
throwsXmlException
Node into an XmlObject.
XmlException
DEPRECATED Superceded by JSR 173
public staticLoads the givenXmlObjectparse(XMLInputStreamxis)
throwsXmlException,XMLStreamException
XMLInputStream into an XmlObject.
XmlException
XMLStreamException
DEPRECATED Superceded by JSR 173
public staticLoads the givenXmlObjectparse(XMLInputStreamxis,XmlOptionsoptions)
throwsXmlException,XMLStreamException
XMLInputStream into an XmlObject.
XmlException
XMLStreamException