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

# Class StyleRule

java.lang.Object
org.eclipse.birt.report.model.core.Structure
org.eclipse.birt.report.model.core.PropertyStructure
org.eclipse.birt.report.model.api.elements.structures.StyleRule

All Implemented Interfaces:
  `Cloneable`, `IStructure`, `org.eclipse.birt.report.model.core.IPropertySet`

Direct Known Subclasses:
  `HighlightRule`, `MapRule`

public abstract class StyleRule extends org.eclipse.birt.report.model.core.PropertyStructure
Base class for highlight and map rules in the style. Choices for the operand are defined in `DesignChoiceConstants`.

See Also:
  - `DesignChoiceConstants`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`IS_DESIGN_TIME_MEMBER`
Status that determines whether this structure is used in design time or not
`protected Boolean`
`isDesignTime`
`protected String`
`operator`
The comparison operator.
`static final String`
`OPERATOR_MEMBER`
Name of the comparison operator member.
`static final String`
`TEST_EXPR_MEMBER`
The expression for this rule.
`protected Expression`
`testExpression`
the test expression for this highlight rule.
`protected List`
`value1`
Expression for the first operand.
`static final String`
`VALUE1_MEMBER`
Name of the property that gives the expression for the first operator operand.
`protected Expression`
`value2`
Expression for the second operand.
`static final String`
`VALUE2_MEMBER`
Name of the property that gives the expression for the second operator operand.

### Fields inherited from class org.eclipse.birt.report.model.core.PropertyStructure

`propValues`

## Constructor Summary

Constructors
Constructor
Description
`StyleRule()`
Default constructor.
`StyleRule(String op, String v1, String v2, String testExpr)`
Constructs the style rule with an operator and its operands.

## Method Summary

Modifier and Type
Method
Description
`protected Object`
`getIntrinsicProperty(String propName)`
Returns the value of a structure property represented as a member variable.
`String`
`getOperator()`
Returns the operator.
`String`
`getTestExpression()`
gets the test expression value of this rule.
`String`
`getValue1()`
Returns the expression for the first operand.
`List`
`getValue1ExpressionList()`
Gets the value1 expression list.
`List`
`getValue1List()`
Deprecated.
`getValue1ExpressionList()`
`String`
`getValue2()`
Returns the expression for the second operand.
`boolean`
`isDesignTime()`
Justifies whether the structure is generated in design time or not.
`void`
`setDesignTime(boolean isDesignTime)`
Sets the design time status for this structure.
`protected void`
`setIntrinsicProperty(String propName, Object value)`
Sets the value of of a structure property represented as a member variable.
`void`
`setOperator(String operator)`
Sets the operator.
`void`
`setTestExpression(String expression)`
sets the test expression for the rule.
`void`
`setValue1(String value)`
Set expression for the first operand.
`void`
`setValue1(List value1List)`
Sets the value 1 expression.
`void`
`setValue2(String value)`
Set expression for the second operand.

### Methods inherited from class org.eclipse.birt.report.model.core.PropertyStructure

`clone, getLocalProperty, getLocalProperty, setProperty`

### Methods inherited from class org.eclipse.birt.report.model.core.Structure

`checkStringMember, copy, equals, getCompatibleValue, getContext, getDefn, getElement, getExpressionProperty, getHandle, getHandle, getMemberDefn, getObjectDefn, getProperty, getProperty, getReferencableProperty, getStringProperty, handle, isReferencable, setContext, setExpressionProperty, setProperty, setupContext, updateReference, validate`

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

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

### Methods inherited from interface org.eclipse.birt.report.model.api.core.IStructure

`getStructName`

## Field Details

### OPERATOR_MEMBER

public static final String OPERATOR_MEMBER
Name of the comparison operator member.

See Also:
  - Constant Field Values

### VALUE1_MEMBER

public static final String VALUE1_MEMBER
Name of the property that gives the expression for the first operator operand.

See Also:
  - Constant Field Values

### VALUE2_MEMBER

public static final String VALUE2_MEMBER
Name of the property that gives the expression for the second operator operand.

See Also:
  - Constant Field Values

### TEST_EXPR_MEMBER

public static final String TEST_EXPR_MEMBER
The expression for this rule.

See Also:
  - Constant Field Values

### IS_DESIGN_TIME_MEMBER

public static final String IS_DESIGN_TIME_MEMBER
Status that determines whether this structure is used in design time or not

See Also:
  - Constant Field Values

### operator

protected String operator
The comparison operator. Default value is `MAP_OPERATOR_EQ`

### value1

protected List value1
Expression for the first operand.

### value2

protected Expression value2
Expression for the second operand.

### testExpression

protected Expression testExpression
the test expression for this highlight rule.

### isDesignTime

protected Boolean isDesignTime

## Constructor Details

### StyleRule

public StyleRule()
Default constructor.

### StyleRule

public StyleRule(String op, String v1, String v2, String testExpr)
Constructs the style rule with an operator and its operands.

Parameters:
  `op` - the choice name for the operand
  `v1` - expression for the first operand
  `v2` - expression for the second operand
  `testExpr` - the expression to check

## Method Details

### getIntrinsicProperty

protected Object getIntrinsicProperty(String propName)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Returns the value of a structure property represented as a member variable.

Overrides:
  `getIntrinsicProperty` in class `org.eclipse.birt.report.model.core.PropertyStructure`
Parameters:
  `propName` - name of the property
Returns:
  the value of the property, or null if the property is not set

### setIntrinsicProperty

protected void setIntrinsicProperty(String propName, Object value)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Sets the value of of a structure property represented as a member variable.

Overrides:
  `setIntrinsicProperty` in class `org.eclipse.birt.report.model.core.PropertyStructure`
Parameters:
  `propName` - the name of the property to set
  `value` - the property value

### getOperator

public String getOperator()
Returns the operator. The possible values are defined in `DesignChoiceConstants`, and they are:

- MAP_OPERATOR_EQ
- MAP_OPERATOR_NE
- MAP_OPERATOR_LT
- MAP_OPERATOR_LE
- MAP_OPERATOR_GE
- MAP_OPERATOR_GT
- MAP_OPERATOR_BETWEEN
- MAP_OPERATOR_NOT_BETWEEN
- MAP_OPERATOR_NULL
- MAP_OPERATOR_NOT_NULL
- MAP_OPERATOR_TRUE
- MAP_OPERATOR_FALSE
- MAP_OPERATOR_LIKE
- MAP_OPERATOR_ANY

Returns:
  the operator

### setOperator

public void setOperator(String operator)
Sets the operator. The allowed values are defined in `DesignChoiceConstants`, and they are:

- MAP_OPERATOR_EQ
- MAP_OPERATOR_NE
- MAP_OPERATOR_LT
- MAP_OPERATOR_LE
- MAP_OPERATOR_GE
- MAP_OPERATOR_GT
- MAP_OPERATOR_BETWEEN
- MAP_OPERATOR_NOT_BETWEEN
- MAP_OPERATOR_NULL
- MAP_OPERATOR_NOT_NULL
- MAP_OPERATOR_TRUE
- MAP_OPERATOR_FALSE
- MAP_OPERATOR_LIKE
- MAP_OPERATOR_ANY

Parameters:
  `operator` - the operator to set

### getValue1

public String getValue1()
Returns the expression for the first operand.

Returns:
  the first operand expression

### getValue1List

@Deprecated public List getValue1List()
Deprecated.
`getValue1ExpressionList()`
Gets the value1 expression list. For most map operator, there is only one expression in the returned list. However, map operator 'in' may contain more than one expression.

Returns:
  the value1 expression list.

### getValue1ExpressionList

public List getValue1ExpressionList()
Gets the value1 expression list. For most map operator, there is only one expression in the returned list. However, map operator 'in' may contain more than one expression.

Returns:
  the value1 expression list. Each item is `Expression` object.

### setValue1

public void setValue1(String value)
Set expression for the first operand.

Parameters:
  `value` - the first operand expression.

### setValue1

public void setValue1(List value1List)
Sets the value 1 expression.

Parameters:
  `value1List` - the value 1 expression list to set

### getValue2

public String getValue2()
Returns the expression for the second operand.

Returns:
  the second operand expression

### setValue2

public void setValue2(String value)
Set expression for the second operand.

Parameters:
  `value` - the second operand expression.

### setTestExpression

public void setTestExpression(String expression)
sets the test expression for the rule.

Parameters:
  `expression` - the expression value

### getTestExpression

public String getTestExpression()
gets the test expression value of this rule.

Returns:
  the expression

### isDesignTime

public boolean isDesignTime()
Description copied from interface: `IStructure`
Justifies whether the structure is generated in design time or not.

Specified by:
  `isDesignTime` in interface `IStructure`
Overrides:
  `isDesignTime` in class `org.eclipse.birt.report.model.core.Structure`
Returns:
  <true> if the structure is generated in design time, otherwise return <false>.

### setDesignTime

public void setDesignTime(boolean isDesignTime)
Sets the design time status for this structure.

Parameters:
  `isDesignTime` -