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

# Class MapRule

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
org.eclipse.birt.report.model.api.elements.structures.MapRule

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

public class MapRule extends StyleRule
This class represents a style mapping rule: a translation of a database value into a set of display values. A map might translate DB status codes (O, S, P) into user-visible strings (Open, Shipped, Paid). The mapping is driven of of a mapping test expression defined on the style. This class extends the `StyleRule` class, see that class for additional details.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`display`
The non-localized text to display when the rule "fires.".
`static final String`
`DISPLAY_ID_MEMBER`
Name of the member variable that represents the message ID for the localized text to display when the rule "fires.".
`static final String`
`DISPLAY_MEMBER`
Name of the member variable that represents the non-localized text to display when the rule "fires.".
`protected String`
`displayKey`
The message ID for the localized text to display when the rule "fires.".
`static final String`
`STRUCTURE_NAME`
Name of this structure within the meta-data dictionary.

### Fields inherited from class org.eclipse.birt.report.model.api.elements.structures.StyleRule

`IS_DESIGN_TIME_MEMBER, isDesignTime, operator, OPERATOR_MEMBER, TEST_EXPR_MEMBER, testExpression, value1, VALUE1_MEMBER, value2, VALUE2_MEMBER`

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

`propValues`

## Constructor Summary

Constructors
Constructor
Description
`MapRule()`
Default constructor.
`MapRule(String op, String v1, String v2, String testExpre, String id, String disp)`
Constructs the map rule with an operator and arguments, message id if the display value is to be localized and display text if the display value is not to be localized.

## Method Summary

Modifier and Type
Method
Description
`IStructureDefn`
`getDefn()`
Gets the structure definition by the name of this structure.
`String`
`getDisplay()`
Returns the non-localized display text.
`String`
`getDisplayKey()`
Returns the message ID for the text.
`protected Object`
`getIntrinsicProperty(String propName)`
Returns the value of a structure property represented as a member variable.
`String`
`getStructName()`
Returns the name of the structure definition.
`StructureHandle`
`handle(SimpleValueHandle valueHandle, int index)`
Creates the specific handle of this structure.
`void`
`setDisplay(String text)`
Set the non-localized display text, the text is to be displayed when this rule applies.
`void`
`setDisplayKey(String displayKey)`
Set the message ID for the text, the text is to be displayed when this rule applies.
`protected void`
`setIntrinsicProperty(String propName, Object value)`
Sets the value of of a structure property represented as a member variable.

### Methods inherited from class org.eclipse.birt.report.model.api.elements.structures.StyleRule

`getOperator, getTestExpression, getValue1, getValue1ExpressionList, getValue1List, getValue2, isDesignTime, setDesignTime, setOperator, setTestExpression, setValue1, setValue1, setValue2`

### 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, getElement, getExpressionProperty, getHandle, getHandle, getMemberDefn, getObjectDefn, getProperty, getProperty, getReferencableProperty, getStringProperty, isReferencable, setContext, setExpressionProperty, setProperty, setupContext, updateReference, validate`

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

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

## Field Details

### DISPLAY_MEMBER

public static final String DISPLAY_MEMBER
Name of the member variable that represents the non-localized text to display when the rule "fires.".

See Also:
  - Constant Field Values

### DISPLAY_ID_MEMBER

public static final String DISPLAY_ID_MEMBER
Name of the member variable that represents the message ID for the localized text to display when the rule "fires.".

See Also:
  - Constant Field Values

### STRUCTURE_NAME

public static final String STRUCTURE_NAME
Name of this structure within the meta-data dictionary.

See Also:
  - Constant Field Values

### display

protected String display
The non-localized text to display when the rule "fires.".

### displayKey

protected String displayKey
The message ID for the localized text to display when the rule "fires.".

## Constructor Details

### MapRule

public MapRule()
Default constructor.

### MapRule

public MapRule(String op, String v1, String v2, String testExpre, String id, String disp)
Constructs the map rule with an operator and arguments, message id if the display value is to be localized and display text if the display value is not to be localized.

Parameters:
  `op` - operator. One of the internal choice values identified in the meta-data dictionary
  `v1` - the comparison value expressions for operators that take one or two arguments (equals, like, between)
  `v2` - the second comparison value for operators that take two arguments (between)
  `testExpre` - the expression to check
  `id` - the message id if the display value is to be localized
  `disp` - the display text if the value is not localized

## Method Details

### getStructName

public String getStructName()
Description copied from interface: `IStructure`
Returns the name of the structure definition. The name is the one used to define the structure in the meta-data dictionary.

Returns:
  the internal name of the structure a defined in the meta-data dictionary.

### 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 `StyleRule`
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 `StyleRule`
Parameters:
  `propName` - the name of the property to set
  `value` - the property value

### getDisplayKey

public String getDisplayKey()
Returns the message ID for the text.

Returns:
  the message ID for the display text

### setDisplayKey

public void setDisplayKey(String displayKey)
Set the message ID for the text, the text is to be displayed when this rule applies.

Parameters:
  `displayKey` - the message ID for the text.

### getDisplay

public String getDisplay()
Returns the non-localized display text.

Returns:
  the non-localized display text

### setDisplay

public void setDisplay(String text)
Set the non-localized display text, the text is to be displayed when this rule applies.

Parameters:
  `text` - the non-localized display text

### getDefn

public IStructureDefn getDefn()
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Gets the structure definition by the name of this structure.

Specified by:
  `getDefn` in interface `IStructure`
Overrides:
  `getDefn` in class `org.eclipse.birt.report.model.core.Structure`
Returns:
  structure definition.

### handle

public StructureHandle handle(SimpleValueHandle valueHandle, int index)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Creates the specific handle of this structure. This handle is always created.

Specified by:
  `handle` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `valueHandle` - the value handle of this structure list property this structure is in
  `index` - the position of this structure in structure list
Returns:
  the handle of this structure.