Class SelectionMapper
- java.lang.Object
-
- org.pentaho.platform.engine.services.runtime.SelectionMapper
-
- All Implemented Interfaces:
org.pentaho.platform.api.engine.ISelectionMapper
public class SelectionMapper extends Object implements org.pentaho.platform.api.engine.ISelectionMapper
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SelectionMapper
create(org.pentaho.commons.connection.IPentahoResultSet resultSet, int valueColIndex, int dispColIndex, String displayName, String displayStyle)
Creates a SelectionMapper based on an IPentahoResultSet.static SelectionMapper
create(org.pentaho.commons.connection.IPentahoResultSet resultSet, String displayName, String displayStyle)
Creates a SelectionMapper based on an IPentahoResultSet.static SelectionMapper
create(org.pentaho.commons.connection.IPentahoResultSet resultSet, String valueColName, String dispColName, String displayName, String displayStyle)
Creates a SelectionMapper based on an IPentahoResultSet.static SelectionMapper
create(org.pentaho.platform.api.engine.IActionParameter actionParam, String valueColName, String dispColName, String displayName, String displayStyle)
Creates a SelectionMapper based on an IActionParameter.static SelectionMapper
createFromPropMapList(List aList, String valueColName, String dispColName, String displayName, String displayStyle)
Creates a SelectionMapper based on a pentaho property map list.String
getDisplayStyle()
String
getSelectionDisplayName()
String
getSelectionNameForValue(String val)
Map
getSelectionNameMap()
List
getSelectionValues()
String
getValueAt(int index)
boolean
hasValue(String value)
int
selectionCount()
String
toString()
-
-
-
Method Detail
-
create
public static SelectionMapper create(org.pentaho.commons.connection.IPentahoResultSet resultSet, String displayName, String displayStyle)
Creates a SelectionMapper based on an IPentahoResultSet. If the result set has 1 column, the values and display names will come from that column. If it has more than 1 column, the first column will be used for the values and the second will be used for the display names- Parameters:
resultSet
- The result set to get the data fromdisplayName
- The name used to describe the choice for this selection. Usually used as a header- Returns:
- SelectionMapper if successful or null
-
create
public static SelectionMapper create(org.pentaho.commons.connection.IPentahoResultSet resultSet, String valueColName, String dispColName, String displayName, String displayStyle)
Creates a SelectionMapper based on an IPentahoResultSet. The columns to use for the values and display names are passed in as column names.- Parameters:
resultSet
- The result set to get the data fromvalueColName
- The name of the column to use for the values. If null, the first column will be useddispColName
- The name of the column to use for the display names. If null, the values column will be useddisplayName
- The name used to describe the choice for this selection. Usually used as a header- Returns:
- SelectionMapper if successful or null
-
create
public static SelectionMapper create(org.pentaho.commons.connection.IPentahoResultSet resultSet, int valueColIndex, int dispColIndex, String displayName, String displayStyle)
Creates a SelectionMapper based on an IPentahoResultSet. The index of the column to use for the values and display names are passed in. The index is 1 based so the first (left most) column is 1.- Parameters:
resultSet
- The result set to get the data fromvalueColName
- The index of the column to use for the values.dispColName
- The index of the column to use for the display names. If 0 then the valueColumn will be used.displayName
- The name used to describe the choice for this selection. Usually used as a header- Returns:
- SelectionMapper if successful or null
-
create
public static SelectionMapper create(org.pentaho.platform.api.engine.IActionParameter actionParam, String valueColName, String dispColName, String displayName, String displayStyle)
Creates a SelectionMapper based on an IActionParameter. The columns to use for the values and display names are passed in as column names.- Parameters:
actionParam
- The ActionParameter to get the data fromvalueColName
- The name of the column to use for the values. If null, the first column will be useddispColName
- The name of the column to use for the display names. If null, the values column will be useddisplayName
- The name used to describe the choice for this selection. Usually used as a header- Returns:
- SelectionMapper if successful or null
-
createFromPropMapList
public static SelectionMapper createFromPropMapList(List aList, String valueColName, String dispColName, String displayName, String displayStyle)
Creates a SelectionMapper based on a pentaho property map list. The index of the column to use for the values and display names are passed in. The index is 1 based so the first (left most) column is 1.- Parameters:
resultSet
- The result set to get the data fromvalueColName
- The index of the column to use for the values.dispColName
- The index of the column to use for the display names. If 0 then the valueColumn will be used.displayName
- The name used to describe the choice for this selection. Usually used as a header- Returns:
- SelectionMapper if successful or null
-
getDisplayStyle
public String getDisplayStyle()
- Specified by:
getDisplayStyle
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
getSelectionDisplayName
public String getSelectionDisplayName()
- Specified by:
getSelectionDisplayName
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
getSelectionNameForValue
public String getSelectionNameForValue(String val)
- Specified by:
getSelectionNameForValue
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
getSelectionValues
public List getSelectionValues()
- Specified by:
getSelectionValues
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
getSelectionNameMap
public Map getSelectionNameMap()
- Specified by:
getSelectionNameMap
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
hasValue
public boolean hasValue(String value)
- Specified by:
hasValue
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
selectionCount
public int selectionCount()
- Specified by:
selectionCount
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
getValueAt
public String getValueAt(int index)
- Specified by:
getValueAt
in interfaceorg.pentaho.platform.api.engine.ISelectionMapper
-
-