Package org.eclipse.birt.report.model.api

# Class Expression

java.lang.Object
org.eclipse.birt.report.model.api.Expression

public class Expression extends Object
Represents the object for the expression. The expression has an expression value and its type.

See Also:
  - `ExpressionType`

## Constructor Summary

Constructors
Constructor
Description
`Expression(Object expr, String type)`
Constructor

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`Object`
`getExpression()`
Return the raw expression if the type is not constant.
`String`
`getStringExpression()`
Return the raw expression if the type is not constant.
`String`
`getType()`
Return the type of the expression.
`String`
`getUserDefinedType()`
Return the type of the expression set by the user.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Expression

public Expression(Object expr, String type)
Constructor

Parameters:
  `expr` - the value
  `type` - the type

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getStringExpression

public String getStringExpression()
Return the raw expression if the type is not constant. If the type is constant, get the value in string.

Returns:
  the raw expression or the value in string

### getExpression

public Object getExpression()
Return the raw expression if the type is not constant. If the type is constant, get the value.

Returns:
  the raw expression or the value

### getType

public String getType()
Return the type of the expression. It can be one of defined in `ExpressionType`. For the compatibility issue, in default, it is `ExpressionType.JAVASCRIPT`.

Returns:
  the type
See Also:
  - `ExpressionType`

### getUserDefinedType

public String getUserDefinedType()
Return the type of the expression set by the user. This method ignore the compatibility issue.

Returns:
  the type
See Also:
  - `ExpressionType`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`