Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.birt.core.data
Class ExpressionUtil

    java.lang.Object
      org.eclipse.birt.core.data.ExpressionUtil

    public final class ExpressionUtil

extends java.lang.Object

This class help to manipulate expressions.

Field Summary
`static java.lang.String` | `DATA_INDICATOR` prefix for column bindings in Cube
`static java.lang.String` | `DATASET_ROW_INDICATOR` prefix for dataset row
`static java.lang.String` | `DIMENSION_INDICATOR` prefix for dimension
`static java.lang.String` | `EXPRESSION_VALUE_SUFFIX`
`static java.lang.String` | `MEASURE_INDICATOR` prefix for measure
`static java.lang.String` | `PARAMETER_INDICATOR` prefix for parameter
`static java.lang.String` | `ROW_INDICATOR` prefix for row

Constructor Summary
`ExpressionUtil()`

Method Summary
`static java.lang.String` | `createDataSetRowExpression(java.lang.String rowName)` Return a dataSetRow expression text according to given row name.
`static java.lang.String` | `createJSDataExpression(java.lang.String dataName)` Return a JS data expression text according to given data name.
`static java.lang.String` | `createJSDataSetRowExpression(java.lang.String rowName)` Return a JS dataSetRow expression text according to given row name.
`static java.lang.String` | `createJSDimensionExpression(java.lang.String dimensionName, java.lang.String levelName)` Return a JS dimension expression text according to given dimension and measure name.By default it is reference to "ID" attribute of that level.
`static java.lang.String` | `createJSDimensionExpression(java.lang.String dimensionName, java.lang.String levelName, java.lang.String attributeName)` Return a JS dimension expression text according to given dimension and measure name.
`static java.lang.String` | `createJSMeasureExpression(java.lang.String measureName)` Return a JS measure expression text according to given measure name.
`static java.lang.String` | `createJSParameterExpression(java.lang.String parameterName)` Return a JS parameter expression text according to given row name.
`static java.lang.String` | `createJSParameterValueExpression(java.lang.String parameterName)` Return a JavaScript parameter value according to an expression.
`static java.lang.String` | `createJSRowExpression(java.lang.String rowName)` Return a JS row expression text according to given row name.
`static java.lang.String` | `createRowExpression(int index)` Deprecated.
`static java.lang.String` | `createRowExpression(java.lang.String rowName)` Return a row expression text according to given row name.
`static java.util.List` | `extractColumnExpressions(java.lang.String oldExpression)` Extract all column expression info
`static java.util.List` | `extractColumnExpressions(java.lang.String oldExpression, boolean mode)` Deprecated. use `extractColumnExpressions( String, String )` instead
`static java.util.List` | `extractColumnExpressions(java.lang.String oldExpression, java.lang.String indicator)` Extract all column expression info
`static IColumnBinding` | `getColumnBinding(java.lang.String oldExpression)` Return an IColumnBinding instance according to given oldExpression.
`static java.lang.String` | `getColumnBindingName(java.lang.String oldExpression)` Get the simplest column binding name.
`static java.lang.String` | `getColumnName(java.lang.String oldExpression)` Get the simplest column binding name.
`static java.lang.String` | `getDataSetNameWithoutPrefix(java.lang.String fullDataSetName)` Gets the data set name with the given full name.
`static java.util.Set<IDimLevel>` | `getReferencedDimLevel(java.lang.String expr)`
`static java.lang.String` | `getReferencedMeasure(java.lang.String expr)`
`static java.lang.String[]` | `getSourceDataSetNames(java.lang.String jointColumName)`
`static boolean` | `hasAggregation(java.lang.String expression)` whethter the expression has aggregation
`static boolean` | `isScalarParamReference(java.lang.String expression)` whether the exression is report paramter reference.The pattern should like params["aa"].if yes, return true.
`static java.lang.String` | `toNewExpression(java.lang.String oldExpression)` Translate the old expression with "row" as indicator to new expression using "dataSetRow" as indicator.
`static java.lang.String` | `updateParentQueryReferenceExpression(java.lang.String oldExpression, boolean isParameterBinding)` Translate the old expression with "rows" as parent query indicator to new expression using "row._outer" as parent query indicator.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ROW_INDICATOR

    public static final java.lang.String ROW_INDICATOR

  prefix for row

  See Also:
    Constant Field Values

### DATASET_ROW_INDICATOR

    public static final java.lang.String DATASET_ROW_INDICATOR

  prefix for dataset row

  See Also:
    Constant Field Values

### PARAMETER_INDICATOR

    public static final java.lang.String PARAMETER_INDICATOR

  prefix for parameter

  See Also:
    Constant Field Values

### MEASURE_INDICATOR

    public static final java.lang.String MEASURE_INDICATOR

  prefix for measure

  See Also:
    Constant Field Values

### DIMENSION_INDICATOR

    public static final java.lang.String DIMENSION_INDICATOR

  prefix for dimension

  See Also:
    Constant Field Values

### DATA_INDICATOR

    public static final java.lang.String DATA_INDICATOR

  prefix for column bindings in Cube

  See Also:
    Constant Field Values

### EXPRESSION_VALUE_SUFFIX

    public static java.lang.String EXPRESSION_VALUE_SUFFIX

Constructor Detail

### ExpressionUtil

    public ExpressionUtil()

Method Detail

### createRowExpression

    public static java.lang.String createRowExpression(java.lang.String rowName)

  Return a row expression text according to given row name.

  Parameters:
    `rowName` -
  Returns:

### createDataSetRowExpression

    public static java.lang.String createDataSetRowExpression(java.lang.String rowName)

  Return a dataSetRow expression text according to given row name.

  Parameters:
    `rowName` -
  Returns:

### createJSRowExpression

    public static java.lang.String createJSRowExpression(java.lang.String rowName)

  Return a JS row expression text according to given row name.

  Parameters:
    `rowName` -
  Returns:

### createJSMeasureExpression

    public static java.lang.String createJSMeasureExpression(java.lang.String measureName)

  Return a JS measure expression text according to given measure name.

  Parameters:
    `measureName` -
  Returns:

### createJSDataExpression

    public static java.lang.String createJSDataExpression(java.lang.String dataName)

  Return a JS data expression text according to given data name.

  Parameters:
    `dataName` -
  Returns:

### createJSDimensionExpression

    public static java.lang.String createJSDimensionExpression(java.lang.String dimensionName,
                                                               java.lang.String levelName)

  Return a JS dimension expression text according to given dimension and measure name.By default it is reference to "ID" attribute of that level.

  Parameters:
    `dimensionName` -
    `levelName` -
  Returns:

### createJSDimensionExpression

    public static java.lang.String createJSDimensionExpression(java.lang.String dimensionName,
                                                               java.lang.String levelName,
                                                               java.lang.String attributeName)

  Return a JS dimension expression text according to given dimension and measure name.

  Parameters:
    `dimensionName` -
    `levelName` -
    `attributeName` -
  Returns:

### createJSDataSetRowExpression

    public static java.lang.String createJSDataSetRowExpression(java.lang.String rowName)

  Return a JS dataSetRow expression text according to given row name.

  Parameters:
    `rowName` -
  Returns:

### createJSParameterExpression

    public static java.lang.String createJSParameterExpression(java.lang.String parameterName)

  Return a JS parameter expression text according to given row name.

  Parameters:
    `rowName` -
  Returns:

### createJSParameterValueExpression

    public static java.lang.String createJSParameterValueExpression(java.lang.String parameterName)

  Return a JavaScript parameter value according to an expression.

  Parameters:
    `expression` -
  Returns:

### createRowExpression

    public static java.lang.String createRowExpression(int index)

  Deprecated.

  Return a row expression text according to given row index, which is 1-based.

  Parameters:
    `index` -
  Returns:

### extractColumnExpressions

    public static java.util.List extractColumnExpressions(java.lang.String oldExpression)
                                                   throws BirtException

  Extract all column expression info

  Parameters:
    `oldExpression` -
  Returns:
  Throws:
    `BirtException`

### getColumnBindingName

    public static java.lang.String getColumnBindingName(java.lang.String oldExpression)
                                                 throws BirtException

  Get the simplest column binding name. Such as row["col1"] pattern, we will return the column name "col1"

  Parameters:
    `oldExpression` -
  Returns:
  Throws:
    `BirtException`

### getColumnName

    public static java.lang.String getColumnName(java.lang.String oldExpression)
                                          throws BirtException

  Get the simplest column binding name. Such as dataSetRow["col1"] pattern, we will return the column name "col1"

  Parameters:
    `oldExpression` -
  Returns:
  Throws:
    `BirtException`

### extractColumnExpressions

    public static java.util.List extractColumnExpressions(java.lang.String oldExpression,
                                                          boolean mode)
                                                   throws BirtException

  Deprecated. use `extractColumnExpressions( String, String )` instead

  Extract all column expression info

  Parameters:
    `oldExpression` -
    `mode` - if true, it means to compile the "row" expression.else extract "dataSetRow" expression
  Returns:
  Throws:
    `BirtException`

### extractColumnExpressions

    public static java.util.List extractColumnExpressions(java.lang.String oldExpression,
                                                          java.lang.String indicator)
                                                   throws BirtException

  Extract all column expression info

  Parameters:
    `oldExpression` -
    `mode` - if true, it means to compile the "row" expression.else extract "dataSetRow" expression
  Returns:
  Throws:
    `BirtException`

### hasAggregation

    public static boolean hasAggregation(java.lang.String expression)

  whethter the expression has aggregation

  Parameters:
    `oldExpression` -
  Returns:
  Throws:
    `BirtException`

### getColumnBinding

    public static IColumnBinding getColumnBinding(java.lang.String oldExpression)

  Return an IColumnBinding instance according to given oldExpression.

  Parameters:
    `oldExpression` -
  Returns:

### toNewExpression

    public static java.lang.String toNewExpression(java.lang.String oldExpression)

  Translate the old expression with "row" as indicator to new expression using "dataSetRow" as indicator.

  Parameters:
    `oldExpression` -
  Returns:

### updateParentQueryReferenceExpression

    public static java.lang.String updateParentQueryReferenceExpression(java.lang.String oldExpression,
                                                                        boolean isParameterBinding)

  Translate the old expression with "rows" as parent query indicator to new expression using "row._outer" as parent query indicator.

  Parameters:
    `oldExpression` -
    `isParameterBinding` -
  Returns:

### isScalarParamReference

    public static boolean isScalarParamReference(java.lang.String expression)

  whether the exression is report paramter reference.The pattern should like params["aa"].if yes, return true. else return false;

  Parameters:
    `expression` -

### getSourceDataSetNames

    public static java.lang.String[] getSourceDataSetNames(java.lang.String jointColumName)

  Parameters:
    `jointColumName` -
  Returns:

### getDataSetNameWithoutPrefix

    public static java.lang.String getDataSetNameWithoutPrefix(java.lang.String fullDataSetName)

  Gets the data set name with the given full name. The full name may contain the library namespace.

  For example,

  - "dataSet1" is extracted from "new_library.dataSet1"

  Parameters:
    `fullDataSetName` - the data set
  Returns:
    the name

### getReferencedDimLevel

    public static java.util.Set<IDimLevel> getReferencedDimLevel(java.lang.String expr)
                                                          throws CoreException

  Parameters:
    `expr` -
  Returns:
  Throws:
    `CoreException`

### getReferencedMeasure

    public static java.lang.String getReferencedMeasure(java.lang.String expr)
                                                 throws CoreException

  Parameters:
    `expr` -
  Returns:
  Throws:
    `CoreException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 Actuate Corp. All rights reserved.