|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
org.pentaho.reporting.engine.classic.core.function.strings.MapIndirectExpression
public class MapIndirectExpression
Returns the value read from a mapped field. The field's value is used as a key to the field-mapping. The expression maps the value into a new column name and returns the value read from this column.
If the mapping does not exist, then the fallback forward is used instead.
| Constructor Summary | |
|---|---|
MapIndirectExpression()
Default Constructor. |
|
| Method Summary | |
|---|---|
String |
getFallbackForward()
Returns the name of the field that is returned if none of the predefined keys matches the lookup-value. |
String |
getField()
Returns the name of the field from where to read the key value. |
String[] |
getForward()
Returns all forward-definitions as string-array. |
String |
getForward(int index)
Retrieves the forward-fieldname for the key at the given position. |
int |
getForwardCount()
Returns the number of forward-definitions that have been defined. |
Expression |
getInstance()
Return a completly separated copy of this function. |
String[] |
getKey()
Returns all defined keys as string array. |
String |
getKey(int index)
Returns a key value at the given index. |
int |
getKeyCount()
Returns the number of keys defined in the expression. |
String |
getNullValue()
Returns the value that is returned if the key-field evaluates to null. |
Object |
getValue()
Performs the lookup by first querying the given field, and then mapping the retrived value into one of the field names. |
boolean |
isIgnoreCase()
Returns, whether the key-lookup should be case-insensitive. |
void |
setFallbackForward(String fallbackForward)
Defines the name of the field that is returned if none of the predefined keys matches the lookup-value. |
void |
setField(String field)
Defines the name of the field from where to read the key value. |
void |
setForward(int index,
String value)
Defines the forward-fieldname for the key at the given position. |
void |
setForward(String[] forwards)
Defiens all forward-definitions using the values of the string-array. |
void |
setIgnoreCase(boolean ignoreCase)
Defines, whether the key-lookup should be case-insensitive. |
void |
setKey(int index,
String key)
Defines a key value to which the lookup-field's value is compared. |
void |
setKey(String[] keys)
Defines all keys using the values from the string array. |
void |
setNullValue(String nullValue)
Defines the value that is returned if the key-field evaluates to null. |
| Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression |
|---|
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapIndirectExpression()
| Method Detail |
|---|
public String getField()
public void setField(String field)
field - the field name.public String getNullValue()
null.
public void setNullValue(String nullValue)
null.
nullValue - the null-value.public String getFallbackForward()
public void setFallbackForward(String fallbackForward)
fallbackForward - the fallback forward field name.
public void setKey(int index,
String key)
index - the index position of the key in the list.key - the key value.public String getKey(int index)
index - the index position of the key in the list.
public int getKeyCount()
public String[] getKey()
public void setKey(String[] keys)
keys - all defined keys.
public void setForward(int index,
String value)
index - the index of the entry.value - the name of the datarow-column that is read if the key is selected.public String getForward(int index)
index - the index of the entry.
public int getForwardCount()
public String[] getForward()
public void setForward(String[] forwards)
forwards - the forward-name array.public boolean isIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
ignoreCase - true, if the key comparison is case-insensitive, false otherwise.public Expression getInstance()
getInstance in interface ExpressiongetInstance in class AbstractExpressionpublic Object getValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||