public class TStreamAdapter extends TXMLObject implements java.io.Serializable
Constructor and Description |
---|
TStreamAdapter()
Default Constructor.
|
TStreamAdapter(org.xml.sax.InputSource inputSource)
Initializes the adapter with the given input source.
|
TStreamAdapter(org.xml.sax.InputSource inputSource,
java.util.Locale locale)
Initializes the adapter with the given input source.
|
TStreamAdapter(org.xml.sax.InputSource inputSource,
java.lang.String systemId)
Initializes the adapter with the given input source.
|
TStreamAdapter(org.xml.sax.InputSource inputSource,
java.lang.String systemId,
java.util.Locale locale)
Initializes the adapter with the given input source.
|
TStreamAdapter(java.io.InputStream inputStream)
Initializes the adapter with the given byte stream.
|
TStreamAdapter(java.io.InputStream inputStream,
java.util.Locale locale)
Initializes the adapter with the given byte stream.
|
TStreamAdapter(java.io.InputStream inputStream,
java.lang.String systemId)
Initializes the adapter with the given byte stream.
|
TStreamAdapter(java.io.InputStream inputStream,
java.lang.String systemId,
java.util.Locale locale)
Initializes the adapter with the given byte stream.
|
TStreamAdapter(java.util.Locale locale)
Default Constructor.
|
TStreamAdapter(java.io.Reader reader)
Initializes the adapter with the given character stream.
|
TStreamAdapter(java.io.Reader reader,
java.util.Locale locale)
Initializes the adapter with the given character stream.
|
TStreamAdapter(java.io.Reader reader,
java.lang.String systemId)
Initializes the adapter with the given character stream.
|
TStreamAdapter(java.io.Reader reader,
java.lang.String systemId,
java.util.Locale locale)
Initializes the adapter with the given character stream.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canWriteToOutputStream()
Indicates if this instance can be currently written to an output stream.
|
java.lang.String |
getDocname()
Gets the ino:docname from this Tamino data object.
|
java.lang.String |
getDoctype()
Gets the doctype for this Tamino data object.
|
java.lang.Object |
getDocument()
Gets the document instance of the underlying object model.
|
java.lang.Object |
getElement()
Gets element instance of the underlying object model.
|
java.lang.String |
getId()
Gets the ino:id attribute for the underlying XML data.
|
protected void |
readDocumentStateFrom(java.io.ObjectInputStream in)
This abstract method serves as a plugin method for readStateFrom.
|
void |
readFrom(java.io.InputStream inputStream)
Reads data from inputStream and initializes the concrete object.
|
void |
readFrom(java.io.InputStream inputStream,
java.lang.String systemId)
Reads data from inputStream and initializes the concrete object.
|
void |
readFrom(java.io.Reader reader)
Reads data from reader and initializes the concrete object.
|
void |
readFrom(java.io.Reader reader,
java.lang.String systemId)
Reads data from reader and initializes the concrete object.
|
void |
setDocname(java.lang.String docname)
Sets the ino:docname.
|
void |
setId(java.lang.String id)
Sets the ino:id for the XML instance.
|
protected void |
writeDocumentStateTo(java.io.ObjectOutputStream out)
This abstract method serves as a plugin method for writeStateTo.
|
void |
writeTo(java.io.OutputStream outputStream,
java.lang.String encoding)
Writes the XML document represented by this TXMLObject instance to the outputStream
passed as parameter.
|
void |
writeTo(java.io.Writer writer,
java.lang.String encoding)
Writes the XML document represented by this TXMLObject instance to the Writer
passed as parameter.
|
getEncoding, getSystemId, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, setContentType, setEncoding, setProperty, setSystemId, writeTo, writeTo
getCollection, getContentType, getLastModified, getLocale, hasCollection, hasDocname, hasDoctype, hasId, readStateFrom, setCollection, setDoctype, setLastModified, setLocale, writeStateTo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContentType
public TStreamAdapter()
public TStreamAdapter(org.xml.sax.InputSource inputSource)
public TStreamAdapter(org.xml.sax.InputSource inputSource, java.lang.String systemId)
public TStreamAdapter(java.io.Reader reader)
public TStreamAdapter(java.io.Reader reader, java.lang.String systemId)
public TStreamAdapter(java.io.InputStream inputStream)
public TStreamAdapter(java.io.InputStream inputStream, java.lang.String systemId)
public TStreamAdapter(java.util.Locale locale)
public TStreamAdapter(org.xml.sax.InputSource inputSource, java.util.Locale locale)
public TStreamAdapter(org.xml.sax.InputSource inputSource, java.lang.String systemId, java.util.Locale locale)
public TStreamAdapter(java.io.Reader reader, java.util.Locale locale)
public TStreamAdapter(java.io.Reader reader, java.lang.String systemId, java.util.Locale locale)
public TStreamAdapter(java.io.InputStream inputStream, java.util.Locale locale)
public TStreamAdapter(java.io.InputStream inputStream, java.lang.String systemId, java.util.Locale locale)
public void setDocname(java.lang.String docname)
setDocname
in class TXMLObject
docname
- is the ino:docname attribute of the data object.public void setId(java.lang.String id)
setId
in class TXMLObject
id
- denoted the ino:id that should be set on an underlying element instance.public java.lang.String getDocname()
getDocname
in class TXMLObject
public java.lang.String getId()
getId
in class TXMLObject
public java.lang.String getDoctype()
getDoctype
in class TDataObject
public java.lang.Object getDocument()
getDocument
in class TXMLObject
public java.lang.Object getElement()
getElement
in class TXMLObject
public void readFrom(java.io.InputStream inputStream) throws TStreamReadException
readFrom
in interface TStreamable
inputStream
- denotes the byte stream from which the object is newly initialized.TStreamReadException
- due to any problems when reading the stream.public void readFrom(java.io.InputStream inputStream, java.lang.String systemId) throws TStreamReadException
readFrom
in interface TXMLStreamable
inputStream
- denotes the byte stream from which the object is newly initialized.systemId
- the base URI of the data to resolve relative references.TStreamReadException
- due to any problems when reading the stream.public void readFrom(java.io.Reader reader) throws TStreamReadException
readFrom
in interface TStreamable
reader
- denotes the character stream from which the object is newly initialized.TStreamReadException
- due to any problems when reading the stream.public void readFrom(java.io.Reader reader, java.lang.String systemId) throws TStreamReadException
readFrom
in interface TXMLStreamable
reader
- denotes the character stream from which the object is newly initialized.systemId
- the base URI to resolve relative references.TStreamReadException
- due to any problems when reading the stream.public void writeTo(java.io.OutputStream outputStream, java.lang.String encoding) throws TStreamWriteException
This method uses the given encoding. The given encoding is always set in the prologue of the stream, i.e. the prologue always looks like this: <?xml ... encoding="..." ...?> and the byte stream representing the XML document is always encoded with the given encoding.
writeTo
in interface TXMLStreamable
writeTo
in class TXMLObject
outputStream
- the byte output stream.encoding
- the encoding used for serializing the XML document.TStreamWriteException
- signals an error while attempting to write the stream.public void writeTo(java.io.Writer writer, java.lang.String encoding) throws TStreamWriteException
This method uses the given encoding. The given encoding is always set in the prologue of the stream, i.e. the prologue always looks like this: <?xml ... encoding="..." ...?>. The character stream representing the XML document is normally not concerned with a particular encoding, unless an OutputStreamWriter is used. An OutputStreamWriter is a converter between a character stream and a byte stream. That conversion is done based on a specific encoding. If an OutputStreamWriter is used with any other encoding than given encoding, there will be a mismatch between the encoding set in the prologue and the encoding of the byte stream. It is therefore recommended to only use an OutputStreamWriter in conjunction with given encoding.
writeTo
in interface TXMLStreamable
writeTo
in class TXMLObject
writer
- the character output stream writer.encoding
- the encoding used for serializing the XML document.TStreamWriteException
- signals an error while attempting to write the stream.protected boolean canWriteToOutputStream()
canWriteToOutputStream
in class TDataObject
protected void writeDocumentStateTo(java.io.ObjectOutputStream out) throws java.io.IOException
writeDocumentStateTo
in class TDataObject
out
- the ObjectOutputStream needed for serialization.java.io.IOException
protected void readDocumentStateFrom(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
readDocumentStateFrom
in class TDataObject
out
- the ObjectOutputStream needed for serialization.java.io.IOException
java.lang.ClassNotFoundException
Copyright (c) 2017 Software AG. All Rights Reserved.