javax.xml.transform.sax

Class SAXSource

Implemented Interfaces:
Source

public class SAXSource
extends java.lang.Object
implements Source

Specifies a SAX XML source. This is a tuple of input source and SAX parser.

Field Summary

static String
FEATURE
Factory feature indicating that SAX sources are supported.

Constructor Summary

SAXSource()
Default constructor.
SAXSource(InputSource inputSource)
Constructor with an input source.
SAXSource(XMLReader reader, InputSource inputSource)
Constructor with a SAX parser and input source.

Method Summary

InputSource
getInputSource()
Returns the input source to parse.
String
getSystemId()
Returns the system ID for this source.
XMLReader
getXMLReader()
Returns the SAX parser to be used by this source.
void
setInputSource(InputSource inputSource)
Sets the input source to parse.
void
setSystemId(String systemId)
Sets the system ID for this source.
void
setXMLReader(XMLReader reader)
Sets the SAX parser to be used by this source.
static InputSource
sourceToInputSource(Source source)
Converts a source into a SAX input source.

Field Details

FEATURE

public static final String FEATURE
Factory feature indicating that SAX sources are supported.

Constructor Details

SAXSource

public SAXSource()
Default constructor.


SAXSource

public SAXSource(InputSource inputSource)
Constructor with an input source. The SAX parser will be instantiated by the transformer.


SAXSource

public SAXSource(XMLReader reader,
                 InputSource inputSource)
Constructor with a SAX parser and input source.

Method Details

getInputSource

public InputSource getInputSource()
Returns the input source to parse.


getSystemId

public String getSystemId()
Returns the system ID for this source.
Specified by:
getSystemId in interface Source


getXMLReader

public XMLReader getXMLReader()
Returns the SAX parser to be used by this source. If null, the transformer will instantiate its own parser.


setInputSource

public void setInputSource(InputSource inputSource)
Sets the input source to parse.


setSystemId

public void setSystemId(String systemId)
Sets the system ID for this source.
Specified by:
setSystemId in interface Source


setXMLReader

public void setXMLReader(XMLReader reader)
Sets the SAX parser to be used by this source. If null, the transformer will instantiate its own parser.


sourceToInputSource

public static InputSource sourceToInputSource(Source source)
Converts a source into a SAX input source. This method can use a StreamSource or the system ID.

Returns:
an input source or null