public class TableWrapper
extends java.lang.Object
implements java.io.Externalizable
TableResultSet
instance will be wrapped in a TableWrapper
instance before
sending it to a remote side. This class is intended to be used only by P2J runtime.Modifier and Type | Field and Description |
---|---|
private boolean |
append
Flag indicating this table is sent in APPEND mode.
|
private boolean |
input
Flag indicating this table is sent in INPUT or INPUT-OUTPUT mode.
|
private boolean |
output
Flag indicating this table is sent in OUTPUT or INPUT-OUTPUT mode.
|
private java.util.List<PropertyDefinition> |
properties
The list of read properties.
|
private TableResultSet |
resultSet
The result set to be sent to the remote side.
|
private java.util.List<java.lang.Object[]> |
rows
The read data.
|
private boolean |
tableHandle
Determines if this wrapper wraps data from a TABLE-HANDLE parameter.
|
private java.lang.String |
tableName
Table name.
|
Constructor and Description |
---|
TableWrapper()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
TableWrapper(TableResultSet resultSet)
Wrap a custom result set in a class known to P2J, so the remote side can deserialize it.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<PropertyDefinition> |
getProperties()
Get the list of read
properties . |
java.util.List<java.lang.Object[]> |
getRows()
Get the list of read
rows . |
java.lang.String |
getTableName()
Returns table name.
|
boolean |
isAppend()
Check if this table is in APPEND mode.
|
boolean |
isInput()
Check if this table is in INPUT or INPUT-OUTPUT mode.
|
boolean |
isOutput()
Check if this table is in OUTPUT or INPUT-OUTPUT mode.
|
boolean |
isTableHandle()
Determines if this wrapper wraps data from a TABLE-HANDLE parameter.
|
java.util.Iterator<PropertyDefinition> |
propertyIterator()
Provides an iterator over the read
properties . |
void |
readExternal(java.io.ObjectInput in)
Read the result set (metadata and rows) from the specified input source.
|
java.util.Iterator<java.lang.Object[]> |
rowIterator()
Provides an iterator over the read
rows . |
void |
setTableHandle(boolean tableHandle)
Set if this wrapper wraps data from a TABLE-HANDLE parameter.
|
void |
setTableName(java.lang.String tableName)
Set table name.
|
void |
writeExternal(java.io.ObjectOutput out)
Send the result set (metadata and rows) to the specified output destination.
|
private TableResultSet resultSet
private java.util.List<PropertyDefinition> properties
private java.util.List<java.lang.Object[]> rows
private boolean input
private boolean output
private boolean append
private java.lang.String tableName
private boolean tableHandle
public TableWrapper()
public TableWrapper(TableResultSet resultSet)
resultSet
- The result set, which is a subclass of TableResultSet
.public boolean isInput()
readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is
set.input
flag.public boolean isOutput()
readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is
set.output
flag.public boolean isAppend()
readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is
set.append
flag.public java.lang.String getTableName()
public void setTableName(java.lang.String tableName)
tableName
- table name.public java.util.Iterator<PropertyDefinition> propertyIterator()
properties
. This is used to access the data
sent by a remote side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.Iterator<java.lang.Object[]> rowIterator()
rows
. This is used to access the data sent by a
remote side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.List<PropertyDefinition> getProperties()
properties
. This is used to access the data sent by a remote
side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.List<java.lang.Object[]> getRows()
rows
. This is used to access the data sent by a remote side,
via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which the result set will be sent.java.io.IOException
- In case of I/O errors.public final void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which the result set will be read.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
public boolean isTableHandle()
true
if this wrapper wraps data from a TABLE-HANDLE parameter.public void setTableHandle(boolean tableHandle)
tableHandle
- true
if this wrapper wraps data from a TABLE-HANDLE parameter.