org.sbml.jsbml.util
public class JAXPFacade extends java.lang.Object implements DocumentFactory, SAX2Parser, NodeWriter
DocumentFactory
,
SAX2Parser
,
NodeWriter
Modifier and Type | Field and Description |
---|---|
private static JAXPFacade |
instance_ |
private static javax.xml.transform.TransformerFactory |
transformer_factory |
Modifier | Constructor and Description |
---|---|
private |
JAXPFacade() |
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Document |
create(java.io.InputStream byteStream,
boolean namespaceAware)
Creates an XML DOM document by parsing the content of the specified byte
stream as XML, using a nonvalidating parser.
|
org.w3c.dom.Document |
create(java.io.InputStream byteStream,
java.lang.Object[] schemas,
org.xml.sax.ErrorHandler handler)
Creates an XML DOM document by parsing the content of the specified byte
stream as XML, using a validating parser.
|
org.w3c.dom.Document |
create(java.io.Reader characterStream,
boolean namespaceAware)
Creates an XML DOM document by parsing the content of the specified
character stream as XML, using a nonvalidating parser.
|
org.w3c.dom.Document |
create(java.io.Reader characterStream,
java.lang.Object[] schemas,
org.xml.sax.ErrorHandler handler)
Creates an XML DOM document by parsing the content of the specified
character stream as XML, using a validating parser.
|
static JAXPFacade |
getInstance()
Creates and returns a new
JAXPFacade . |
void |
parse(java.io.InputStream byteStream,
org.xml.sax.helpers.DefaultHandler handler,
boolean namespaceAware)
Parses the content of a byte stream as XML, using a nonvalidating
parser and the specified SAX2 default event handler.
|
void |
parse(java.io.InputStream byteStream,
org.xml.sax.helpers.DefaultHandler handler,
java.lang.Object[] schemas)
Parses the content of a byte stream as XML, using a validating
parser and the specified SAX2 default event handler.
|
void |
parse(java.io.Reader characterStream,
org.xml.sax.helpers.DefaultHandler handler,
boolean namespaceAware)
Parses the content of a character stream as XML, using a
nonvalidating parser and the specified SAX2 default event handler.
|
void |
parse(java.io.Reader characterStream,
org.xml.sax.helpers.DefaultHandler handler,
java.lang.Object[] schemas)
Parses the content of a character stream as XML, using a
validating parser and the specified SAX2 default event handler.
|
void |
write(org.w3c.dom.Node node,
java.io.OutputStream byteStream,
boolean indent)
Writes an XML DOM node to the specified byte stream.
|
void |
write(org.w3c.dom.Node node,
java.io.OutputStream byteStream,
javax.xml.transform.stream.StreamSource streamSource,
boolean indent)
Writes an XML DOM node to the specified byte stream, using a
javax.xml.transform.Transformer instance created from
streamSource . |
void |
write(org.w3c.dom.Node node,
java.io.Writer characterStream,
boolean indent)
Writes an XML DOM node to the specified character stream.
|
static void |
write(org.w3c.dom.Node node,
java.io.Writer characterStream,
javax.xml.transform.stream.StreamSource streamSource,
boolean indent)
Writes an XML DOM node to the specified character stream, using a
javax.xml.transform.Transformer instance created from
streamSource . |
private static JAXPFacade instance_
private static javax.xml.transform.TransformerFactory transformer_factory
public static JAXPFacade getInstance()
JAXPFacade
.JAXPFacade
.public static void write(org.w3c.dom.Node node, java.io.Writer characterStream, javax.xml.transform.stream.StreamSource streamSource, boolean indent)
javax.xml.transform.Transformer
instance created from
streamSource
.node
- The org.w3c.dom.Node
instance representing the
XML DOM node to be written to characterStream
.characterStream
- The character stream where node
is to be written.streamSource
- An object that holds an URI, input stream, etc.indent
- Flag to indicate whether the output should be indented or not.java.lang.NullPointerException
- If node
or characterStream
are
null
.java.lang.RuntimeException
- If any error occurs (transformer configuration errors,
transformer errors).public org.w3c.dom.Document create(java.io.InputStream byteStream, boolean namespaceAware) throws org.xml.sax.SAXException
create
in interface DocumentFactory
byteStream
- The byte stream which content is parsed as XML to create the
XML DOM document.namespaceAware
- A flag to indicate whether the parser should know about
namespaces or not.org.w3c.dom.Document
instance representing the
XML DOM document created from the byteStream
XML
content.org.xml.sax.SAXException
java.lang.NullPointerException
- If byteStream
is null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public org.w3c.dom.Document create(java.io.InputStream byteStream, java.lang.Object[] schemas, org.xml.sax.ErrorHandler handler) throws org.xml.sax.SAXException
create
in interface DocumentFactory
byteStream
- The byte stream whose content is parsed as XML to create the
XML DOM document.schemas
- An optional array of either java.io.File
instances containing the abstract pathnames, or of
java.io.String
instances containing the URIs,
pointing to the schemas to use in the validation process. If
set to null
, the schemas defined in the data set
will be used. If set to null
and no schemas are
found in the data set, an
org.xml.sax.SAXParseException
is thrown.handler
- The error handler to be used to report errors occurred while
parsing the byteStream
XML content. Setting this
to null
will result in the underlying
implementation using it's own default implementation and
behavior.org.w3c.dom.Document
instance representing the
XML DOM document created from the byteStream
XML
content.org.xml.sax.SAXException
java.lang.NullPointerException
- If byteStream
is null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public org.w3c.dom.Document create(java.io.Reader characterStream, boolean namespaceAware) throws org.xml.sax.SAXException
create
in interface DocumentFactory
characterStream
- The character stream whose content is parsed as XML to create
the XML DOM document.namespaceAware
- A flag to indicate whether the parser should know about
namespaces or not.org.w3c.dom.Document
instance representing the
XML DOM document created from the characterStream
XML content.org.xml.sax.SAXException
java.lang.NullPointerException
- If characterStream
is null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public org.w3c.dom.Document create(java.io.Reader characterStream, java.lang.Object[] schemas, org.xml.sax.ErrorHandler handler)
create
in interface DocumentFactory
characterStream
- The character stream whose content is parsed as XML to create
the XML DOM document.schemas
- An optional array of either java.io.File
instances containing the abstract pathnames, or of
java.io.String
instances containing the URIs,
pointing to the schemas to use in the validation process. If
set to null
, the schemas defined in the data set
will be used. If set to null
and no schemas are
found in the data set, an
org.xml.sax.SAXParseException
is thrown.handler
- The error handler to be used to report errors occurred while
parsing the characterStream
XML content. Setting
this to null
will result in the underlying
implementation using it's own default implementation and
behavior.org.w3c.dom.Document
instance representing the
XML DOM document created from the characterStream
XML content.java.lang.NullPointerException
- If characterStream
is null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public void parse(java.io.InputStream byteStream, org.xml.sax.helpers.DefaultHandler handler, boolean namespaceAware)
parse
in interface SAX2Parser
byteStream
- The byte stream which content has to be parsed as XML.handler
- The SAX2 default event handler to use for parsing
byteStream
.namespaceAware
- A flag to indicate whether the parser should know about
namespaces or not.java.lang.NullPointerException
- If byteStream
or handler
are
null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public void parse(java.io.InputStream byteStream, org.xml.sax.helpers.DefaultHandler handler, java.lang.Object[] schemas)
parse
in interface SAX2Parser
byteStream
- The byte stream which content has to be parsed as XML.handler
- The SAX2 default event handler to use for parsing
byteStream
.schemas
- An optional array of either java.io.File
instances containing the abstract pathnames, or of
java.io.String
instances containing the URIs,
pointing to the schemas to use in the validation process. If
set to null
, the schemas defined in the data set
will be used. If set to null
and no schemas are
found in the data set, an
org.xml.sax.SAXParseException
is thrown.java.lang.NullPointerException
- If byteStream
or handler
are
null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public void parse(java.io.Reader characterStream, org.xml.sax.helpers.DefaultHandler handler, boolean namespaceAware)
parse
in interface SAX2Parser
characterStream
- The character stream which content has to be parsed as XML.handler
- The SAX2 default event handler to use for parsing
characterStream
.namespaceAware
- A flag to indicate whether the parser should know about
namespaces or not.java.lang.NullPointerException
- If characterStream
or handler
are
null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public void parse(java.io.Reader characterStream, org.xml.sax.helpers.DefaultHandler handler, java.lang.Object[] schemas)
parse
in interface SAX2Parser
characterStream
- The character stream which content has to be parsed as XML.handler
- The SAX2 default event handler to use for parsing
characterStream
.schemas
- An optional array of either java.io.File
instances containing the abstract pathnames, or of
java.io.String
instances containing the URIs,
pointing to the schemas to use in the validation process. If
set to null
, the schemas defined in the data set
will be used. If set to null
and no schemas are
found in the data set, an
org.xml.sax.SAXParseException
is thrown.java.lang.NullPointerException
- If characterStream
or handler
are
null
.java.lang.RuntimeException
- If any error occurs (parser configuration errors, I/O errors,
SAX parsing errors).public void write(org.w3c.dom.Node node, java.io.OutputStream byteStream, boolean indent)
write
in interface NodeWriter
node
- The org.w3c.dom.Node
instance representing the
XML DOM node to be written to byteStream
.byteStream
- The byte stream where node
is to be written.indent
- Flag to indicate whether the output should be indented or not.java.lang.NullPointerException
- If node
or byteStream
are
null
.java.lang.RuntimeException
- If any error occurs (transformer configuration errors,
transformer errors).public void write(org.w3c.dom.Node node, java.io.OutputStream byteStream, javax.xml.transform.stream.StreamSource streamSource, boolean indent)
javax.xml.transform.Transformer
instance created from
streamSource
.node
- The org.w3c.dom.Node
instance representing the
XML DOM node to be written to byteStream
.byteStream
- The byte stream where node
is to be written.streamSource
- An object that holds an URI, input stream, etc.indent
- Flag to indicate whether the output should be indented or not.java.lang.NullPointerException
- If node
or byteStream
are
null
.java.lang.RuntimeException
- If any error occurs (transformer configuration errors,
transformer errors).public void write(org.w3c.dom.Node node, java.io.Writer characterStream, boolean indent)
write
in interface NodeWriter
node
- The org.w3c.dom.Node
instance representing the
XML DOM node to be written to characterStream
.characterStream
- The character stream where node
is to be written.indent
- Flag to indicate whether the output should be indented or not.java.lang.NullPointerException
- If node
or characterStream
are
null
.java.lang.RuntimeException
- If any error occurs (transformer configuration errors,
transformer errors).