# SAXSource

public class **SAXSource** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Source](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Source.html) <br />

Acts as an holder for SAX-style Source.

Note that XSLT requires namespace support. Attempting to transform an
input source that is not
generated with a namespace-aware parser may result in errors.
Parsers can be made namespace aware by calling the
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/parsers/SAXParserFactory.html#setNamespaceAware(boolean)` method.

<br />

### Constant Summary

|---|---|---|
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [FEATURE](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#FEATURE) | If `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/TransformerFactory.html#getFeature(java.lang.String)` returns true when passed this value as an argument, the Transformer supports Source input of this type. |

### Public Constructor Summary

|---|---|
|   | [SAXSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#SAXSource())() Zero-argument default constructor. |
|   | [SAXSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#SAXSource(org.xml.sax.XMLReader,%20org.xml.sax.InputSource))([XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) reader, [InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) inputSource) Create a `SAXSource`, using an `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html` and a SAX InputSource. |
|   | [SAXSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#SAXSource(org.xml.sax.InputSource))([InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) inputSource) Create a `SAXSource`, using a SAX `InputSource`. |

### Public Method Summary

|---|---|
| [InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) | [getInputSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#getInputSource())() Get the SAX InputSource to be used for the Source. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#getSystemId())() Get the base ID (URI or system ID) from where URIs will be resolved. |
| [XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) | [getXMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#getXMLReader())() Get the XMLReader to be used for the Source. |
| void | [setInputSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#setInputSource(org.xml.sax.InputSource))([InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) inputSource) Set the SAX InputSource to be used for the Source. |
| void | [setSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#setSystemId(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId) Set the system identifier for this Source. |
| void | [setXMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#setXMLReader(org.xml.sax.XMLReader))([XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) reader) Set the XMLReader to be used for the Source. |
| static [InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) | [sourceToInputSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#sourceToInputSource(javax.xml.transform.Source))([Source](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Source.html) source) Attempt to obtain a SAX InputSource object from a Source object. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [javax.xml.transform.Source](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Source.html)

|---|---|
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Source.html#getSystemId())() Get the system identifier that was set with setSystemId. |
| abstract void | [setSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Source.html#setSystemId(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId) Set the system identifier for this Source. |

## Constants

#### public static final [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**FEATURE**

If `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/TransformerFactory.html#getFeature(java.lang.String)`
returns true when passed this value as an argument,
the Transformer supports Source input of this type.
Constant Value: "http://javax.xml.transform.sax.SAXSource/feature"

## Public Constructors

#### public
**SAXSource**
()

<br />

Zero-argument default constructor. If this constructor is used, and
no SAX source is set using
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXSource.html#setInputSource(org.xml.sax.InputSource)` , then the
`Transformer` will
create an empty source `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html` using
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html#InputSource()`.

<br />

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Transformer.html#transform(javax.xml.transform.Source,%20javax.xml.transform.Result)`

#### public
**SAXSource**
([XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) reader, [InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) inputSource)

Create a `SAXSource`, using an `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html`
and a SAX InputSource. The `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Transformer.html`
or `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXTransformerFactory.html` will set itself
to be the reader's `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html`, and then will call
reader.parse(inputSource).

##### Parameters

| 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](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) inputSource)

Create a `SAXSource`, using a SAX `InputSource`.
The `https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Transformer.html` or
`https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/sax/SAXTransformerFactory.html` creates a
reader via `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderFactory.html`
(if setXMLReader is not used), sets itself as
the reader's `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html`, and calls
reader.parse(inputSource).

##### Parameters

| inputSource | An input source reference that must be non-null and that will be passed to the parse method of the reader. |
|---|---|

## Public Methods

#### public [InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html)
**getInputSource**
()

Get the SAX InputSource to be used for the Source.

##### Returns

- A valid InputSource reference, or null.

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getSystemId**
()

<br />

Get the base ID (URI or system ID) from where URIs
will be resolved.

<br />

##### Returns

- Base URL for the `Source`, or `null`.

#### public [XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html)
**getXMLReader**
()

Get the XMLReader to be used for the Source.

##### Returns

- A valid XMLReader or XMLFilter reference, or null.

#### public void
**setInputSource**
([InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) inputSource)

Set the SAX InputSource to be used for the Source.

##### Parameters

| inputSource | A valid InputSource reference. |
|---|---|

#### public void
**setSystemId**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId)

Set the system identifier for this Source. If an input source
has already been set, it will set the system ID or that
input source, otherwise it will create a new input source.

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).

<br />

##### Parameters

| systemId | The system identifier as a URI string. |
|---|---|

#### public void
**setXMLReader**
([XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) reader)

Set the XMLReader to be used for the Source.

##### Parameters

| reader | A valid XMLReader or XMLFilter reference. |
|---|---|

#### public static [InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html)
**sourceToInputSource**
([Source](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/Source.html) source)

Attempt to obtain a SAX InputSource object from a Source
object.

##### Parameters

| source | Must be a non-null Source reference. |
|---|---|

##### Returns

- An InputSource, or null if Source can not be converted.