public class TNonXMLObject extends TDataObject implements java.io.Serializable
A TNonXMLObject instance can either be obtained from Tamino or can be instantiated via one of the newInstance factory methods. The choice of the factory method determines the way in which the non-XML document can be accessed. If you use one of the factory methods that takes an InputStream instance or file name as input parameter, the non-XML document can only be accessed as a byte stream via the getInputStream method; the getReader method returns null. If you use one of the factory methods that takes a Reader instance as input parameter, the non-XML document can be only accessed as a character stream via the getReader method; the getInputStream method returns null. A TNonXMLObject instance obtained from Tamino always contains a byte input stream. This implies that you can use the getInputStream method to access the non-XML document as a stream; the getReader method always returns null.
Modifier | Constructor and Description |
---|---|
protected |
TNonXMLObject(java.io.InputStream inputStream,
boolean isInputClosable)
Initializes the TNonXMLObject with the given byte input stream.
|
protected |
TNonXMLObject(java.io.InputStream inputStream,
boolean isInputClosable,
java.util.Locale locale)
Initializes the TNonXMLObject with the given byte input stream.
|
protected |
TNonXMLObject(java.io.InputStream inputStream,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType)
Initializes the TNonXMLObject instance with the given byte input stream,
collection, schema, object name and content type.
|
protected |
TNonXMLObject(java.io.InputStream inputStream,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType,
java.util.Locale locale)
Initializes the TNonXMLObject instance with the given byte input stream,
collection, schema, object name and content type.
|
protected |
TNonXMLObject(java.io.Reader reader)
Initializes the TNonXMLObject with the given character input stream.
|
protected |
TNonXMLObject(java.io.Reader reader,
java.util.Locale locale)
Initializes the TNonXMLObject with the given character input stream.
|
protected |
TNonXMLObject(java.io.Reader reader,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType)
Initializes the TNonXMLObject instance with the given character input stream, collection,
schema, object name and content type.
|
protected |
TNonXMLObject(java.io.Reader reader,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType,
java.util.Locale locale)
Initializes the TNonXMLObject instance with the given character input stream, collection,
schema, object name and content type.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canWriteToOutputStream()
Indicates if the content of the TNonXMLObject instance can be written to an output stream; it
indicates if the invocation of the writeTo method is possible.
|
java.lang.String |
getDocname()
Gets the ino:docname attribute of this Tamino document.
|
java.lang.String |
getId()
Gets the ino:id attribute of this Tamino document.
|
java.io.InputStream |
getInputStream()
Gets the byte input stream representing the content of the non-XML document.
|
java.io.Reader |
getReader()
Gets the character input stream representing the content of the non-XML document.
|
boolean |
hasConsumableStream()
Indicates if the content of the TNonXMLObject instance can be written to an output stream; it
indicates if the invocation of the writeTo method is possible.
|
static TNonXMLObject |
newInstance(java.io.InputStream inputStream)
Factory method for the instantiation of a TNonXMLObject instance with the given byte input stream.
|
static TNonXMLObject |
newInstance(java.io.InputStream inputStream,
java.util.Locale locale)
Factory method for the instantiation of a TNonXMLObject instance with the given byte input stream.
|
static TNonXMLObject |
newInstance(java.io.InputStream inputStream,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType)
Factory method for the instantiation of a TNonXMLObject instance with the given byte input stream,
collection, schema, object name and content type.
|
static TNonXMLObject |
newInstance(java.io.InputStream inputStream,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType,
java.util.Locale locale)
Factory method for the instantiation of a TNonXMLObject instance with the given byte input stream,
collection, schema, object name and content type.
|
static TNonXMLObject |
newInstance(java.io.Reader reader)
Factory method for the instantiation of a TNonXMLObject instance with the given character input stream.
|
static TNonXMLObject |
newInstance(java.io.Reader reader,
java.util.Locale locale)
Factory method for the instantiation of a TNonXMLObject instance with the given character input stream.
|
static TNonXMLObject |
newInstance(java.io.Reader reader,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType)
Factory method for the instantiation of a TNonXMLObject instance with the given character input
stream, collection, schema, object name and content type.
|
static TNonXMLObject |
newInstance(java.io.Reader reader,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType,
java.util.Locale locale)
Factory method for the instantiation of a TNonXMLObject instance with the given character input
stream, collection, schema, object name and content type.
|
static TNonXMLObject |
newInstance(java.lang.String file)
Factory method for the instantiation of a TNonXMLObject instance with the given file name.
|
static TNonXMLObject |
newInstance(java.lang.String file,
java.util.Locale locale)
Factory method for the instantiation of a TNonXMLObject instance with the given file name.
|
static TNonXMLObject |
newInstance(java.lang.String file,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType)
Factory method for the instantiation of a TNonXMLObject instance with the given file name,
collection, schema, object name and content type.
|
static TNonXMLObject |
newInstance(java.lang.String file,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
java.lang.String contentType,
java.util.Locale locale)
Factory method for the instantiation of a TNonXMLObject instance with the given file name,
collection, schema, object name and content type.
|
protected void |
readDocumentStateFrom(java.io.ObjectInputStream in)
This abstract method serves as a plugin method for readStateFrom.
|
void |
readFrom(java.io.InputStream inputStream)
Sets the byte input stream for the non-XML document.
|
void |
readFrom(java.io.Reader reader)
Sets the character input stream for the non-XML document.
|
void |
setDocname(java.lang.String docname)
Sets the ino:docname attribute of this Tamino document.
|
void |
setId(java.lang.String id)
Sets the ino:id attribute of this Tamino document.
|
protected void |
writeDocumentStateTo(java.io.ObjectOutputStream out)
This method serves as a plugin method for writeStateTo.
|
void |
writeTo(java.io.OutputStream outputStream)
Writes the content of the non-XML document to the given outputStream.
|
void |
writeTo(java.io.Writer writer)
Writes the content of the non-XML document to the given writer.
|
getCollection, getContentType, getDoctype, getLastModified, getLocale, hasCollection, hasDocname, hasDoctype, hasId, readStateFrom, setCollection, setContentType, setDoctype, setLastModified, setLocale, writeStateTo
protected TNonXMLObject(java.io.InputStream inputStream, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of the non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.protected TNonXMLObject(java.io.InputStream inputStream, boolean isInputClosable)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.isInputClosable
- indicate whether writeTo() will close the input.protected TNonXMLObject(java.io.Reader reader, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.protected TNonXMLObject(java.io.Reader reader)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.protected TNonXMLObject(java.io.InputStream inputStream, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType, java.util.Locale locale)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of the non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.protected TNonXMLObject(java.io.InputStream inputStream, boolean isInputClosable, java.util.Locale locale)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.isInputClosable
- indicate whether writeTo() will close the input.protected TNonXMLObject(java.io.Reader reader, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType, java.util.Locale locale)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.protected TNonXMLObject(java.io.Reader reader, java.util.Locale locale)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.public static TNonXMLObject newInstance(java.io.InputStream inputStream, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.public static TNonXMLObject newInstance(java.io.InputStream inputStream)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.public static TNonXMLObject newInstance(java.io.Reader reader, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.public static TNonXMLObject newInstance(java.io.Reader reader)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.public static TNonXMLObject newInstance(java.lang.String file, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType)
file
- a file name. to be used as input to Tamino.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.public static TNonXMLObject newInstance(java.lang.String file)
file
- a file name. to be used as input to Tamino.public static TNonXMLObject newInstance(java.io.InputStream inputStream, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType, java.util.Locale locale)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.public static TNonXMLObject newInstance(java.io.InputStream inputStream, java.util.Locale locale)
inputStream
- a byte input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.public static TNonXMLObject newInstance(java.io.Reader reader, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType, java.util.Locale locale)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.public static TNonXMLObject newInstance(java.io.Reader reader, java.util.Locale locale)
reader
- a character input stream to be used as input to Tamino or
as output from Tamino as a result of a previous query or retrieve operation.public static TNonXMLObject newInstance(java.lang.String file, java.lang.String collection, java.lang.String doctype, java.lang.String docname, java.lang.String contentType, java.util.Locale locale)
file
- a file name. to be used as input to Tamino.collection
- the collection name of this non-XML document.doctype
- the doctype name of the non-XML document. The doctype must exist in the collection given as
input parameter.docname
- the docname of the non-XML document.contentType
- the content type of the non-XML document.public static TNonXMLObject newInstance(java.lang.String file, java.util.Locale locale)
file
- a file name. to be used as input to Tamino.public void readFrom(java.io.InputStream inputStream) throws TStreamReadException
readFrom
in interface TStreamable
inputStream
- a byte input stream.TStreamReadException
- signals an error while attempting to read the stream.public void readFrom(java.io.Reader reader) throws TStreamReadException
readFrom
in interface TStreamable
reader
- a character input stream.TStreamReadException
- signals an error while attempting to read the stream.public void writeTo(java.io.OutputStream outputStream) throws TStreamWriteException
writeTo
in interface TStreamable
outputStream
- the byte stream to which the content of the non-XML document is written.TStreamWriteException
- signals an error while attempting to write the stream.public void writeTo(java.io.Writer writer) throws TStreamWriteException
writeTo
in interface TStreamable
writer
- the character stream to which the content of the non-XML document is written.TStreamWriteException
- signals an error while attempting to write the stream.protected boolean canWriteToOutputStream()
canWriteToOutputStream
in class TDataObject
public void setDocname(java.lang.String docname)
setDocname
in class TDataObject
docname
- the ino:docname attribute of this TNonXMLObject instance.public void setId(java.lang.String id)
setId
in class TDataObject
id
- the ino:id attribute of this TDataObject instance.public java.io.InputStream getInputStream()
public java.io.Reader getReader()
public java.lang.String getDocname()
getDocname
in class TDataObject
public java.lang.String getId()
getId
in class TDataObject
public boolean hasConsumableStream()
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.