Class AbstractScalarParameterHandleImpl

  • All Implemented Interfaces:
    org.eclipse.birt.report.model.elements.interfaces.IAbstractScalarParameterModel, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, org.eclipse.birt.report.model.elements.interfaces.IInternalAbstractScalarParameterModel, org.eclipse.birt.report.model.elements.interfaces.IParameterModel
    Direct Known Subclasses:
    AbstractScalarParameterHandle

    public abstract class AbstractScalarParameterHandleImpl
    extends ParameterHandle
    implements org.eclipse.birt.report.model.elements.interfaces.IAbstractScalarParameterModel
    Represents the abstract scalar parameter types.
    See Also:
    AbstractScalarParameter
    • Constructor Detail

      • AbstractScalarParameterHandleImpl

        public AbstractScalarParameterHandleImpl​(org.eclipse.birt.report.model.core.Module module,
                                                 org.eclipse.birt.report.model.core.DesignElement element)
        Constructor.
        Parameters:
        module - the module
        element - the model representation of the element
    • Method Detail

      • setIsRequired

        public void setIsRequired​(boolean isRequired)
                           throws SemanticException
        Sets the flag that indicates whether the value of the parameter is required. For string type parameter, if the value is required, it cannot be null or empty. For other type parameters, required value cannot be null.
        Parameters:
        isRequired - true if the value is required. Otherwise false.
        Throws:
        SemanticException - if the property is locked.
      • isRequired

        public boolean isRequired()
        Tests whether the string value of the parameter is required. For string type parameter, if the value is required, it cannot be null or empty. For other type parameters, required value cannot be null.
        Returns:
        true if the value is required. Otherwise false.
      • setSortByColumn

        public void setSortByColumn​(java.lang.String sortByColumn)
                             throws SemanticException
        Sets the expression by which the result sorts.
        Parameters:
        sortByColumn - expression by which the result sorts
        Throws:
        SemanticException
      • getSortByColumn

        public java.lang.String getSortByColumn()
        Gets the expression by which the result sorts.
        Returns:
        the expression by which the result sorts
      • setSortDirection

        public void setSortDirection​(java.lang.String direction)
                              throws SemanticException
        Sets the sort order for parameter values when preview. The input argument can be
        • DesignChoiceConstants.SORT_DIRECTION_ASC
        • DesignChoiceConstants.SORT_DIRECTION_DESC
        • null
        Parameters:
        direction -
        Throws:
        SemanticException - if the property is locked.
      • getSortDirection

        public java.lang.String getSortDirection()
        Gets the sort order for parameter values when preview. The return value can be
        • DesignChoiceConstants.SORT_DIRECTION_ASC
        • DesignChoiceConstants.SORT_DIRECTION_DESC
        • null
        Returns:
        the sort order for parameter values
      • setSortBy

        public void setSortBy​(java.lang.String sortValue)
                       throws SemanticException
        Sets the sort key for parameter values when preview. The input argument can be
        • DesignChoiceConstants.PARAM_SORT_VALUES_VALUE
        • DesignChoiceConstants.PARAM_SORT_VALUES_LABEL
        Parameters:
        sortValue -
        Throws:
        SemanticException - if the property is locked.
      • getSortBy

        public java.lang.String getSortBy()
        Gets the sort key for parameter values when preview. The return value can be
        • DesignChoiceConstants.PARAM_SORT_VALUES_VALUE
        • DesignChoiceConstants.PARAM_SORT_VALUES_LABEL
        Returns:
        the sort key for parameter values
      • getValueType

        public java.lang.String getValueType()
        Returns the parameter type for this scalar parameter. Types are defined in DesignChoiceConstants can be one of the followings:
        • PARAM_VALUE_TYPE_STATIC
        • PARAM_VALUE_TYPE_DYNAMIC
        Returns:
        the type for the scalar parameter
        See Also:
        setValueType(String), DesignChoiceConstants
      • setValueType

        public void setValueType​(java.lang.String type)
                          throws SemanticException
        Sets the parameter value type for this scalar parameter. Types are defined in DesignChoiceConstants can be one of the followings:
        • PARAM_TYPE_STATIC
        • PARAM_TYPE_DYNAMIC
        Parameters:
        type - the type for the scalar parameter
        Throws:
        SemanticException - if the input type is not one of above choices.
        See Also:
        getValueType(), DesignChoiceConstants
      • setListlimit

        public void setListlimit​(int listLimit)
                          throws SemanticException
        Set the value for the list limitation number. This property is used to limit the parameter display list.
        Parameters:
        listLimit - The limited number.
        Throws:
        SemanticException
      • getListlimit

        public int getListlimit()
        get the list limited number.
        Returns:
        the display prompt.
      • getValueExpr

        public java.lang.String getValueExpr()
        Returns an expression on the data row from the dynamic list data set that returns the value for the choice.
        Returns:
        the expression that returns the parameter value for each row in the dynamic list.
      • setValueExpr

        public void setValueExpr​(java.lang.String valueExpr)
                          throws SemanticException
        Sets an expression on the data row from the dynamic list data set that returns the value for the choice.
        Parameters:
        valueExpr - the expression that returns the parameter value for each row in the dynamic list.
        Throws:
        SemanticException - if the property is locked.
      • getLabelExpr

        public java.lang.String getLabelExpr()
        Returns an expression on the data row from the dynamic list data set that returns the prompt for the choice.
        Returns:
        an expression that returns the display value for each row in the dynamic list.
      • setLabelExpr

        public void setLabelExpr​(java.lang.String labelExpr)
                          throws SemanticException
        Sets an expression on the data row from the dynamic list data set that returns the prompt for the choice.
        Parameters:
        labelExpr - an expression that returns the display value for each row in the dynamic list.
        Throws:
        SemanticException - if the property is locked.
      • setDataSetName

        public void setDataSetName​(java.lang.String dataSetName)
                            throws SemanticException
        Sets the data set name of the dynamic list for this parameter.
        Parameters:
        dataSetName - the data set name of the dynamic list
        Throws:
        SemanticException - if the property is locked.
      • setDataSet

        public void setDataSet​(DataSetHandle handle)
                        throws SemanticException
        Sets the data set of the report item.
        Parameters:
        handle - the handle of the data set, if handle is null, data set property will be cleared.
        Throws:
        SemanticException - if the property is locked.
      • choiceIterator

        public java.util.Iterator choiceIterator()
        Returns the iterator for the static selection list defined on this scalar parameter. Each element in the iterator is the an instance of SelectionChoiceHandle.
        Returns:
        the iterator for selection list defined on this scalar parameter.
        See Also:
        SelectionChoice
      • getDataSetName

        public java.lang.String getDataSetName()
        Returns the data set name of the dynamic list for this parameter.
        Returns:
        the data set name of the dynamic list
      • getDataSet

        public DataSetHandle getDataSet()
        Returns the handle for the data set defined on the parameter. If the parameter do not define the data set name or if the data set is not defined in the design/library scope, return null.
        Returns:
        the handle to the data set
      • setDefaultValueList

        public void setDefaultValueList​(java.util.List<? extends java.lang.Object> defaultValueList)
                                 throws SemanticException
        Sets the default value list of the parameter. Each item in the list can be an expression, but cannot reference any other parameters.
        Parameters:
        defaultValueList - the default value for the parameter
        Throws:
        SemanticException - if the property is locked.
      • getDefaultValueList

        public java.util.List getDefaultValueList()
        Returns the default value list of the parameter. Each item in this list can be an expression, but cannot reference any other parameters.
        Returns:
        the default value
      • getDataType

        public java.lang.String getDataType()
        Returns the data type for this parameter. The data type controls how the requester formats, parses and validates the parameter. Types are defined in DesignChoiceConstants can be one of the followings:
        • PARAM_TYPE_STRING
        • PARAM_TYPE_FLOAT
        • PARAM_TYPE_DECIMAL
        • PARAM_TYPE_INTEGER
        • PARAM_TYPE_DATETIME
        • PARAM_TYPE_DATE
        • PARAM_TYPE_TIME
        • PARAM_TYPE_BOOLEAN
        Returns:
        the type for the parameter
        See Also:
        setDataType(String), DesignChoiceConstants
      • setDataType

        public void setDataType​(java.lang.String type)
                         throws SemanticException
        Sets the data type for this parameter. The data type controls how the Requester formats, parses and validates the parameter. Types are defined in DesignChoiceConstants can be one of the followings:
        • PARAM_TYPE_STRING
        • PARAM_TYPE_FLOAT
        • PARAM_TYPE_DECIMAL
        • PARAM_TYPE_INTEGER
        • PARAM_TYPE_DATETIME
        • PARAM_TYPE_DATE
        • PARAM_TYPE_TIME
        • PARAM_TYPE_BOOLEAN
        Parameters:
        type - the type for the parameter
        Throws:
        SemanticException - if the input type is not one of above choices.
        See Also:
        getDataType(), DesignChoiceConstants
      • setDistinct

        public void setDistinct​(boolean distinct)
                         throws SemanticException
        Sets the flag that indicates whether duplicate values should be shown when preview.
        Parameters:
        distinct - true if duplicate values only show once. Otherwise false.
        Throws:
        SemanticException - if the property is locked.
      • distinct

        public boolean distinct()
        Checks whether duplicate values should be shown when preview.
        Returns:
        true if duplicate values only show once. Otherwise false.