Class SelectionMapper

  • All Implemented Interfaces:
    org.pentaho.platform.api.engine.ISelectionMapper

    public class SelectionMapper
    extends Object
    implements org.pentaho.platform.api.engine.ISelectionMapper
    • 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 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​(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 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​(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 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
      • 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 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
      • 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 org.pentaho.platform.api.engine.ISelectionMapper
      • getSelectionDisplayName

        public String getSelectionDisplayName()
        Specified by:
        getSelectionDisplayName in interface org.pentaho.platform.api.engine.ISelectionMapper
      • getSelectionNameForValue

        public String getSelectionNameForValue​(String val)
        Specified by:
        getSelectionNameForValue in interface org.pentaho.platform.api.engine.ISelectionMapper
      • getSelectionValues

        public List getSelectionValues()
        Specified by:
        getSelectionValues in interface org.pentaho.platform.api.engine.ISelectionMapper
      • getSelectionNameMap

        public Map getSelectionNameMap()
        Specified by:
        getSelectionNameMap in interface org.pentaho.platform.api.engine.ISelectionMapper
      • hasValue

        public boolean hasValue​(String value)
        Specified by:
        hasValue in interface org.pentaho.platform.api.engine.ISelectionMapper
      • selectionCount

        public int selectionCount()
        Specified by:
        selectionCount in interface org.pentaho.platform.api.engine.ISelectionMapper
      • getValueAt

        public String getValueAt​(int index)
        Specified by:
        getValueAt in interface org.pentaho.platform.api.engine.ISelectionMapper
      • toString

        public String toString()
        Specified by:
        toString in interface org.pentaho.platform.api.engine.ISelectionMapper
        Overrides:
        toString in class Object