public class TargetData extends java.lang.Object implements Serializator
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
fileName
The file name if such destination was created.
|
private boolean |
isStream
Test whether the target object is a stream or a handle to a stream.
|
private BaseDataType |
origDst
The original destination of the operation.
|
private java.lang.String |
origType
The type of original destination of the operation.
|
private java.io.OutputStream |
stream
Normalized output stream
|
private static java.util.Map<java.lang.String,java.lang.Integer> |
supportedStreams |
static java.lang.String |
TD_SERIALIZE_ROW
Constant used to identify the calls from SERIALIZE-ROW method.
|
static java.lang.String |
TD_WRITE_JSON
Constant used to identify the calls from WRITE-JSON method.
|
static java.lang.String |
TD_WRITE_XML
Constant used to identify the calls from WRITE-XML method.
|
static java.lang.String |
TD_WRITE_XMLSCHEMA
Constant used to identify the calls from WRITE-XMLSCHEMA method.
|
SER_FILE, SER_HANDLE, SER_JSON_ARRAY, SER_JSON_OBJECT, SER_LONGCHAR, SER_MEMPTR, SER_STREAM, SER_STREAM_HANDLE, TYPE_FILE, TYPE_HANDLE, TYPE_JSON_ARRAY, TYPE_JSON_OBJECT, TYPE_LONGCHAR, TYPE_MEMPTR, TYPE_STREAM, TYPE_STREAM_HANDLE| Constructor and Description |
|---|
TargetData(character type,
BaseDataType target)
The constructor saves the configured parameters but does not process them in any way.
|
TargetData(java.lang.String type,
BaseDataType target)
The constructor saves the configured parameters but does not process them in any way.
|
TargetData(java.lang.String type,
java.lang.String target)
The constructor saves the configured parameters but does not process them in any way.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the output stream underlying this data source.
|
boolean |
configureSupportedTargets(java.lang.String method,
java.lang.String format,
java.lang.String widgetType)
Configures the supported resource types for the current usage.
|
java.lang.Object |
getDestination()
Obtain the original destination of the operation.
|
java.io.OutputStream |
getStream()
Get the output stream representing the target resource to which data will be written.
|
java.lang.String |
getType()
Obtain the original type of the stream.
|
boolean |
isJson()
Checks if the target of this operation is a Json or Json Array object.
|
boolean |
isStream()
Checks if the target of this operation is a STREAM-type object.
|
private java.io.OutputStream stream
private java.lang.String fileName
public static final java.lang.String TD_WRITE_XML
public static final java.lang.String TD_WRITE_XMLSCHEMA
public static final java.lang.String TD_WRITE_JSON
public static final java.lang.String TD_SERIALIZE_ROW
private static final java.util.Map<java.lang.String,java.lang.Integer> supportedStreams
private final java.lang.String origType
private final BaseDataType origDst
private boolean isStream
public TargetData(character type, BaseDataType target)
type - The source stream type.target - The reference to resource or the file name.public TargetData(java.lang.String type,
BaseDataType target)
type - The source stream type.target - The reference to resource or the file name.public TargetData(java.lang.String type,
java.lang.String target)
type - The source stream type.target - The file name.public boolean configureSupportedTargets(java.lang.String method,
java.lang.String format,
java.lang.String widgetType)
method - The identifier for the method using the source stream. It is used to get the set of acceptable
stream types to check against them.widgetType - The parent widget. Only used for composing the error messages.true if the parameters configured in constructor seems correct. This method does not
check the content, only the variable types. If there is not a match with the possible streams
supported by the method, false is returned, after eventually raising a specific
error condition.public java.io.OutputStream getStream()
getStream in interface Serializatorpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException - if there is an error closing the stream.public boolean isJson()
true if the target of this operation is a Json or Json Array object.public boolean isStream()
true if the target of this operation is a STREAM-type object.public java.lang.Object getDestination()
public java.lang.String getType()