public class TableData extends Object implements Cloneable, Serializable
Attribute extended CPAObjects (i.e. currently only the Channel object)
support CPA Cache specific data types, besides the following basic Java
types: String, int, long and boolean. The data fields of the adapter type
specific Channel object can be defined through the adapter type meta data
(schema). Currently supported additional data types are the
BinaryData
and TableData
objects. Such data fields
can be read from a Channel object by the attribute name (defined in the
schema), using the methods getValueAsBinary
or
getValueAsTable
. The adapters using the CPA Cache service API
should never need to create the described data container objects and should
always retrieve them from a given Channel object, instead.
The TableData
object is a container for table data, which can be
read from the Channel object, as configured in the Integration Directory or
PCK configuration UI. TableData
represent a table instance, as
defined in the adapter specific meta data (schema). It offers some basic
methods to retrieve data from the tables rows and columns. This rudimentary
table implementation does not support key columns (unique column value
check).
BinaryData
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
TableData.Row
The inner class
Row represents one row of the table. |
Modifier and Type | Field and Description |
---|---|
protected LinkedList<String> |
columnNames |
protected LinkedList<TableData.Row> |
rows |
Constructor and Description |
---|
TableData(LinkedList<String> columnNames)
The default constructor for the
TableData object. |
TableData(String tableName,
LinkedList<String> columnNames)
The constructor for the
TableData object. |
Modifier and Type | Method and Description |
---|---|
void |
addRow(TableData.Row row)
Adds a row to the table.
|
Object |
clone()
This method clones the structure of the given table.
|
LinkedList |
getColumnNames()
Returns a list of all column names, defined for this table.
|
TableData.Row |
getRow(int rowNumber)
Returns a Row by index.
|
int |
getRowCount()
Returns the amount of currently stored rows in this table.
|
LinkedList<TableData.Row> |
getRows(String fieldName,
String fieldValue)
Returns all Rows, where the specified column name contains a given value.
|
String |
getTableName()
Returns the name of the table.
|
String |
retrieveTableValueByKeyColumn(String columnName,
String keyColName,
String keyColValue)
Returns the value of the given column name from a Rows, where the
specified key column name matches the given key value (first occurrence).
|
String |
toString() |
protected LinkedList<String> columnNames
protected LinkedList<TableData.Row> rows
public TableData(LinkedList<String> columnNames)
TableData
object. Using this
cunstructor, the table name remains undefined.columnNames
- A LinkedList
containing the tables column names.public TableData(String tableName, LinkedList<String> columnNames)
TableData
object. This constructor
creates a named table instance.tableName
- The name of the table.columnNames
- A LinkedList
containing the tables column names.public String getTableName()
public LinkedList getColumnNames()
LinkedList
of column names.public int getRowCount()
public void addRow(TableData.Row row)
row
- The Row to add to the table.public TableData.Row getRow(int rowNumber)
rowNumber
- The number of the Row to return.public LinkedList<TableData.Row> getRows(String fieldName, String fieldValue)
fieldName
- The column name, for which the value is to be checked.fieldValue
- The value for which the content of the column specified by the
fieldName parameter is to be checked.LinkedList
containing all Rows where the content
of the checked column matched the given value.public String retrieveTableValueByKeyColumn(String columnName, String keyColName, String keyColValue)
columnName
- The column name, for which the value is to be returned, in
case that the content of the given keyColName column matches
the keyColValue.keyColName
- The column name, for which the content is to be checked for
the given keyColValue.keyColValue
- The value for which the content of the given keyColName column
is to be checked.null
.public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] SAP_XIAF
|
[sap.com] com.sap.aii.af.svc.facade
|
api
|
BC-XI
|
Copyright 2019 SAP AG Complete Copyright Notice