Class ColumnConfig


  • public final class ColumnConfig
    extends Object
    A wrapper around the various ways of structuring report columns.

    This object produces a standard column representation that can be consumed by various ResultSet processing classes. The properties of a column that can be represented by this class are:

    • column: a required string that can be parsed by ColumnToken
    • ifEmpty: an optional fallback column token that can be used if the first results in null
    • field: a unique name for this column
    • header: an optional header name for this column
    • renderScript: an optional Beanshell script that can be used to further render a column value

    An instance of this class can be constructed from:

    • A String column token (parsed by ColumnToken)
    • A Map containing any of the above column arguments
    • An IIQ ReportColumnConfig object (e.g., from a report executor)
    • Another instance of this class (to copy)

    If a String column token is provided, the value for field will be the first component of the token.

    An instance of ReportColumnConfig may contain vastly more properties than are used here. This implementation is not guaranteed to have the same semantics as Sailpoint’s reporting use of that class.

    • Constructor Detail

      • ColumnConfig

        public ColumnConfig​(Object rcc)
        Constructs a ColumnConfig from the given input.

        The input must be a String, which will be interpreted as a column token, a ReportColumnConfig object, which will be taken as-is, a Map, or an instance of this class, which will be copied.

        If you specify a Map, it must at least contain a ‘column’ value.

        Parameters:
        rcc - The input argument
      • ColumnConfig

        public ColumnConfig​(String column,
                            String fallbackColumn)
        Constructs a ColumnConfig with a fallback property, which will be used if the main property value is null.
        Parameters:
        column - The column token to use first
        fallbackColumn - The column token to try if the first result is null (optional)
    • Method Detail

      • getColumnToken

        public ColumnToken getColumnToken()
        Gets the parsed column token value
        Returns:
        The parsed column token value
      • getField

        public String getField()
        Gets the field name of this column.

        This will be the key in the Map returned from ResultSetIterator.nextRow() and ResultSetIterator.getFieldHeaderMap(). It is NOT used in any way for SQL.

        The result will be equal to:

        1) The value of this object's 'field' property if withFieldName(java.lang.String) has been used

        2) the value of the wrapped ReportColumnConfig's 'field'

        3) Otherwise, it will be the base name of the main column without any type tokens. If the property name is 'col1:timestamp:yyyy-MM-dd', the output of this method would be 'col1'.

        All other scenarios will result in an exception.

        Returns:
        The field name
      • getIfEmpty

        public String getIfEmpty()
        Returns the ‘fallback’ column token string
        Returns:
        The column token string to use if the main column is null
      • getIfEmptyColumnToken

        public ColumnToken getIfEmptyColumnToken()
        Gets the column token for the ifEmpty fallback column
        Returns:
        The column token, if one exists, or else null
      • getProperty

        public String getProperty()
        Returns the ‘main’ column token, e.g., “col1” or “col1:boolean”.

        The first part of this value will be the name of the column extracted from the SQL ResultSet. The remaining parts will be used for type derivation, if needed.

        This will either be the value of ‘column’ or the property field on a ReportColumnConfig. This is also the value parsed as the primary column token.

        Returns:
        The column token string to read
      • getRenderDef

        public sailpoint.object.DynamicValue getRenderDef()
      • withFieldName

        public ColumnConfig withFieldName​(String fieldName)
        Constructs a copy of this ColumnConfig with the given field name.
        Parameters:
        fieldName - The field name to set in the copied ColumnConfig
        Returns:
        A new ColumnConfig object with the field name set to that value
      • withHeader

        public ColumnConfig withHeader​(String header)
        Constructs a copy of this ColumnConfig with the given header.
        Parameters:
        header - The header to set in the copied ColumnConfig
        Returns:
        A new ColumnConfig object with the header
      • withRenderRule

        public ColumnConfig withRenderRule​(sailpoint.object.Rule rule)
        Constructs a copy of this ColumnConfig with the given render rule.

        The Rule object will NOT be copied, so you must ensure that it is properly detached from the context or that the rules will always run in the context that loaded the Rule object.

        Parameters:
        rule - The rule object
        Returns:
        A new ColumnConfig object with the renderRule set to the given Rule
      • withRenderScript

        public ColumnConfig withRenderScript​(sailpoint.object.Script script)
        Constructs a copy of this ColumnConfig with the given render script.

        The Script object itself will also be copied to avoid caching thread-safety problems.

        Parameters:
        script - The render script
        Returns:
        A new ColumnConfig object with the renderScript set to the given Script