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 |
asXml
Flag indicating if the transfer is made via XML.
|
private java.lang.String |
errorString
The ERROR-STRING attribute for this table definition.
|
private boolean |
fromJson
Flag indicating if the source is a JSON table.
|
private java.lang.String |
indexes
A string with all indexes of this table definition encoded as a
String . |
private boolean |
input
Flag indicating this table is sent in INPUT or INPUT-OUTPUT mode.
|
private int |
numIndexes
The number of indexes in this table definition.
|
private boolean |
output
Flag indicating this table is sent in OUTPUT or INPUT-OUTPUT mode.
|
private TableWrapper |
peerDef
The peer table.
|
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 java.util.List<java.lang.Object[]> |
rowsMeta
A set of meta information for each row, as given by
TempTableRecord.toArray() . |
private boolean |
tableHandle
Determines if this wrapper wraps data from a TABLE-HANDLE parameter.
|
private java.lang.String |
tableName
Table name.
|
private int |
tableType
The table BEFORE/AFTER type.
|
private java.lang.String |
xmlNodeName
The XML-NODE-NAME attribute for this table definition.
|
private java.lang.String |
xmlns
The XML namespace for this table definition.
|
private java.lang.String |
xmlPrefix
The XML prefix for this table definition.
|
private java.lang.String |
xmlTable
For SOAP web services, the TABLE is sent (and received) serialized as XML.
|
Constructor and Description |
---|
TableWrapper()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
TableWrapper(boolean input,
boolean output,
boolean tableHandle)
Create a new wrapper.
|
TableWrapper(boolean fromJson,
TableResultSet resultSet)
Wrap a custom result set in a class known to P2J, so the remote side can deserialize it.
|
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.lang.String |
getErrorString()
Obtain the ERROR-STRING attribute for this table definition.
|
java.lang.String |
getIndexes()
Get the
indexes . |
int |
getNumIndexes()
Get the
numIndexes . |
TableWrapper |
getPeerDef()
Get the
peerDef . |
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.util.List<java.lang.Object[]> |
getRowsMeta()
Get the list of read
rowsMeta . |
java.lang.String |
getTableName()
Returns table name.
|
java.lang.String |
getXmlNodeName()
Obtain the XML node name for this table definition.
|
java.lang.String |
getXmlns()
Get the
XML namespace . |
java.lang.String |
getXmlPrefix()
Get the
XML prefix . |
java.lang.String |
getXmlTable()
Get the
xmlTable . |
void |
init(TempTable table)
Initialize this wrapper with the info from the given temp-table.
|
boolean |
isAfterTable()
Check whether this is a
TableWrapper for an AFTER-TABLE. |
boolean |
isAppend()
Check if this table is in APPEND mode.
|
boolean |
isAsXml()
Get the
asXml flag. |
boolean |
isFromJson()
Check if the source is a JSON.
|
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.
|
boolean |
isValid()
Returns
true if this wrapper contains a valid data set. |
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 . |
java.util.Iterator<java.lang.Object[]> |
rowMetaIterator()
Provides an iterator over the read
rowsMeta . |
void |
setAsXml(boolean asXml)
Set the
asXml flag. |
void |
setErrorString(java.lang.String err)
Sets the ERROR-STRING attribute for this table definition.
|
void |
setIndexes(java.lang.String indexes)
Set the
indexes . |
void |
setNumIndexes(int numIndexes)
Set the
numIndexes . |
void |
setPeerDef(TableWrapper peerDef)
Configures this object as a
TableWrapper for an AFTER-TABLE. |
void |
setProperties(java.util.List<PropertyDefinition> properties)
Set the table's properties.
|
void |
setRows(java.util.List<java.lang.Object[]> rows)
Set the table's rows.
|
void |
setRowsMeta(java.util.List<java.lang.Object[]> rowsMeta)
Set the table rows' meta information.
|
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 |
setXmlNodeName(java.lang.String xmlNodeName)
Sets the XML node name for this table definition.
|
void |
setXmlns(java.lang.String xmlns)
Set the
XML namespace |
void |
setXmlPrefix(java.lang.String xmlPrefix)
Set the
XML prefix |
void |
setXmlTable(java.lang.String xmlTable)
Set the
xmlTable . |
java.lang.String |
toString()
Get a string representation of this table.
|
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 java.util.List<java.lang.Object[]> rowsMeta
TempTableRecord.toArray()
.private boolean input
private boolean output
private boolean append
private java.lang.String tableName
private boolean tableHandle
private int tableType
private TableWrapper peerDef
private int numIndexes
private java.lang.String xmlns
private java.lang.String xmlPrefix
private java.lang.String xmlNodeName
private java.lang.String errorString
private java.lang.String indexes
String
.
See multiIxCols syntax on
https://documentation.progress.com/output/ua/OpenEdge_latest/dvjav/Constructor_2.htmlprivate boolean fromJson
private java.lang.String xmlTable
private boolean asXml
public TableWrapper()
public TableWrapper(boolean input, boolean output, boolean tableHandle)
input
- Flag indicating the wrapper is in INPUT mode.output
- Flag indicating the wrapper is in OUTPUT mode.tableHandle
- Flag indicating the wrapper is for a TABLE-HANDLE.public TableWrapper(TableResultSet resultSet)
resultSet
- The result set, which is a subclass of TableResultSet
.public TableWrapper(boolean fromJson, TableResultSet resultSet)
fromJson
- Flag indicating if the table is from a JSON source.resultSet
- The result set, which is a subclass of TableResultSet
.public void setXmlTable(java.lang.String xmlTable)
xmlTable
.xmlTable
- The XML representation of the table.public java.lang.String getXmlTable()
xmlTable
.public void setAsXml(boolean asXml)
asXml
flag.asXml
- When true
, the table is transferred via its XML representation.public boolean isAsXml()
asXml
flag.public boolean isAfterTable()
TableWrapper
for an AFTER-TABLE.true
if this is a TableWrapper
for an AFTER-TABLE.public void setPeerDef(TableWrapper peerDef)
TableWrapper
for an AFTER-TABLE.
Note: the peerDef
is set-up as a BEFORE wrapper but the link to this object (its
AFTER-TABLE wrapper) is not created (added as a comment).
peerDef
- The TableWrapper
for existing temp-table that will be the new BEFORE-TABLE.public TableWrapper getPeerDef()
peerDef
.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 int getNumIndexes()
numIndexes
.public void setNumIndexes(int numIndexes)
numIndexes
.numIndexes
- The number of indexes in this table.public java.lang.String getIndexes()
indexes
.public void setIndexes(java.lang.String indexes)
indexes
.indexes
- The String representation of the indexes.public java.lang.String getXmlns()
XML namespace
.public void setXmlns(java.lang.String xmlns)
XML namespace
xmlns
- The XML namespace.public java.lang.String getXmlPrefix()
XML prefix
.public void setXmlPrefix(java.lang.String xmlPrefix)
XML prefix
xmlPrefix
- The XML prefix.public java.lang.String getXmlNodeName()
public void setXmlNodeName(java.lang.String xmlNodeName)
xmlNodeName
- XML prefix for this table definition.public java.lang.String getErrorString()
public void setErrorString(java.lang.String err)
err
- ERROR-STRING attribute for this table definition.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.Iterator<java.lang.Object[]> rowMetaIterator()
rowsMeta
. This is used to access the row meta
information 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 java.util.List<java.lang.Object[]> getRowsMeta()
rowsMeta
. This is used to access the row meta information
sent by a remote side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public void setProperties(java.util.List<PropertyDefinition> properties)
properties
- The property definitions.public void setRows(java.util.List<java.lang.Object[]> rows)
rows
- The table data.public void setRowsMeta(java.util.List<java.lang.Object[]> rowsMeta)
rowsMeta
- The meta information for each row.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 boolean isFromJson()
fromJson
flag.public void setTableHandle(boolean tableHandle)
tableHandle
- true
if this wrapper wraps data from a TABLE-HANDLE parameter.public void init(TempTable table)
table
- The table to copy state from.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isValid()
true
if this wrapper contains a valid data set.true
if this wrapper contains a valid data set.