|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.xml.transform.sax.SAXSource
Acts as an holder for SAX-style Source.
Field Summary | |
static String |
FEATURE
If TransformerFactory.getFeature(java.lang.String)
returns true when passed this value as an argument,
the Transformer supports Source input of this type. |
Constructor Summary | |
SAXSource()
Zero-argument default constructor. |
|
SAXSource(InputSource inputSource)
Create a SAXSource , using a SAX InputSource . |
|
SAXSource(XMLReader reader,
InputSource inputSource)
Create a SAXSource , using an XMLReader
and a SAX InputSource. |
Method Summary | |
InputSource |
getInputSource()
Get the SAX InputSource to be used for the Source. |
String |
getSystemId()
Get the base ID (URI or system ID) from where URIs will be resolved. |
XMLReader |
getXMLReader()
Get the XMLReader to be used for the Source. |
void |
setInputSource(InputSource inputSource)
Set the SAX InputSource to be used for the Source. |
void |
setSystemId(String systemId)
Set the system identifier for this Source. |
void |
setXMLReader(XMLReader reader)
Set the XMLReader to be used for the Source. |
static InputSource |
sourceToInputSource(Source source)
Attempt to obtain a SAX InputSource object from a TrAX Source object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String FEATURE
TransformerFactory.getFeature(java.lang.String)
returns true when passed this value as an argument,
the Transformer supports Source input of this type.
Constructor Detail |
public SAXSource()
Transformer
assumes an empty input tree, with a default root node.
public SAXSource(XMLReader reader, InputSource inputSource)
SAXSource
, using an XMLReader
and a SAX InputSource. The Transformer
or SAXTransformerFactory
will set itself
to be the reader's ContentHandler
, and then will call
reader.parse(inputSource).
reader
- An XMLReader to be used for the parse.inputSource
- A SAX input source reference that must be non-null
and that will be passed to the reader parse method.public SAXSource(InputSource inputSource)
SAXSource
, using a SAX InputSource
.
The Transformer
or
SAXTransformerFactory
creates a
reader via XMLReaderFactory
(if setXMLReader is not used), sets itself as
the reader's ContentHandler
, and calls
reader.parse(inputSource).
inputSource
- An input source reference that must be non-null
and that will be passed to the parse method of the reader.Method Detail |
public void setXMLReader(XMLReader reader)
reader
- A valid XMLReader or XMLFilter reference.public XMLReader getXMLReader()
public void setInputSource(InputSource inputSource)
inputSource
- A valid InputSource reference.public InputSource getInputSource()
public void setSystemId(String systemId)
The system identifier is optional if there is a byte stream or a character stream, but it is still useful to provide one, since the application can use it to resolve relative URIs and can include it in error messages and warnings (the parser will attempt to open a connection to the URI only if no byte stream or character stream is specified).
setSystemId
in interface Source
systemId
- The system identifier as a URI string.public String getSystemId()
getSystemId
in interface Source
public static InputSource sourceToInputSource(Source source)
source
- Must be a non-null Source reference.
|
JavaTM 2 Platform Std. Ed. v1.4.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2003, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.