org.pentaho.platform.engine.services.runtime
Class SelectionMapper

java.lang.Object
  extended by org.pentaho.platform.engine.services.runtime.SelectionMapper
All Implemented Interfaces:
ISelectionMapper

public class SelectionMapper
extends Object
implements ISelectionMapper


Method Summary
static SelectionMapper create(IPentahoResultSet resultSet, int valueColIndex, int dispColIndex, String displayName, String displayStyle)
          Creates a SelectionMapper based on an IPentahoResultSet.
static SelectionMapper create(IPentahoResultSet resultSet, String displayName, String displayStyle)
          Creates a SelectionMapper based on an IPentahoResultSet.
static SelectionMapper create(IPentahoResultSet resultSet, String valueColName, String dispColName, String displayName, String displayStyle)
          Creates a SelectionMapper based on an IPentahoResultSet.
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()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static SelectionMapper create(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 from
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(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 from
valueColName - The name of the column to use for the values. If null, the first column will be used
dispColName - The name of the column to use for the display names. If null, the values column 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(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 from
valueColName - 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

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 from
valueColName - 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 interface ISelectionMapper

getSelectionDisplayName

public String getSelectionDisplayName()
Specified by:
getSelectionDisplayName in interface ISelectionMapper

getSelectionNameForValue

public String getSelectionNameForValue(String val)
Specified by:
getSelectionNameForValue in interface ISelectionMapper

getSelectionValues

public List getSelectionValues()
Specified by:
getSelectionValues in interface ISelectionMapper

getSelectionNameMap

public Map getSelectionNameMap()
Specified by:
getSelectionNameMap in interface ISelectionMapper

hasValue

public boolean hasValue(String value)
Specified by:
hasValue in interface ISelectionMapper

selectionCount

public int selectionCount()
Specified by:
selectionCount in interface ISelectionMapper

getValueAt

public String getValueAt(int index)
Specified by:
getValueAt in interface ISelectionMapper

toString

public String toString()
Specified by:
toString in interface ISelectionMapper
Overrides:
toString in class Object