|
||||||||||
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.TextFormatExpression
public class TextFormatExpression
A TextFormatExpression uses a java.text.MessageFormat to concat and format one or more values evaluated from an expression, function or report datasource.
The TextFormatExpression uses the pattern property to define the global format-pattern used when evaluating the expression. The dataRow fields used to fill the expressions placeholders are defined in a list of properties where the property-names are numbers. The property counting starts at "0". The Syntax of thepattern
property is explained in the class MessageFormat
.
Example:
TheInvoice for your order from {0, date, EEE, MMM d, yyyy} printdate
MessageFormatExpression
allows to specify
named field-references in the pattern, which greatly simplifies the pattern-definition.
Constructor Summary | |
---|---|
TextFormatExpression()
Deprecated. Default constructor, creates a new unnamed TextFormatExpression. |
Method Summary | |
---|---|
String |
getEncoding()
Deprecated. Returns the defined character encoding that is used to transform the Java-Unicode strings into bytes. |
String[] |
getField()
Deprecated. Returns all defined fields as array of strings. |
String |
getField(int index)
Deprecated. Returns the defined field at the given index-position. |
int |
getFieldCount()
Deprecated. Returns the number of fields defined in this expression. |
Expression |
getInstance()
Deprecated. Return a completly separated copy of this function. |
String |
getPattern()
Deprecated. Returns the pattern defined for this expression. |
Object |
getValue()
Deprecated. Evaluates the expression by collecting all values defined in the fieldlist from the datarow. |
boolean |
isUrlEncodeResult()
Deprecated. Queries, whether the formatted result-string will be URL encoded. |
boolean |
isUrlEncodeValues()
Deprecated. Queries, whether the values read from the data-row should be URL encoded. |
void |
setEncoding(String encoding)
Deprecated. Defines the character encoding that is used to transform the Java-Unicode strings into bytes. |
void |
setField(int index,
String field)
Deprecated. Defines the field in the field-list at the given index. |
void |
setField(String[] fields)
Deprecated. Defines all fields as array. |
void |
setPattern(String pattern)
Deprecated. Defines the pattern for this expression. |
void |
setUrlEncodeResult(boolean urlEncodeResult)
Deprecated. Defines, whether the formatted result-string will be URL encoded. |
void |
setUrlEncodeValues(boolean urlEncode)
Deprecated. Defines, whether the values read from the data-row should be URL encoded. |
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 TextFormatExpression()
Method Detail |
---|
public String getEncoding()
public void setEncoding(String encoding)
encoding
- the encoding.public void setUrlEncodeValues(boolean urlEncode)
urlEncode
- true, if the values from the data-row should be URL encoded before they are passed to the
MessageFormat, false otherwise.public boolean isUrlEncodeValues()
public boolean isUrlEncodeResult()
public void setUrlEncodeResult(boolean urlEncodeResult)
urlEncodeResult
- true, if the formatted result will be encoded, false otherwise.public Object getValue()
public String getPattern()
public void setPattern(String pattern)
pattern
- the pattern stringpublic Expression getInstance()
getInstance
in interface Expression
getInstance
in class AbstractExpression
public void setField(int index, String field)
index
- the position in the list, where the field should be defined.field
- the name of the field.public String getField(int index)
index
- the position of the field name that should be queried.
public int getFieldCount()
public String[] getField()
public void setField(String[] fields)
fields
- the new list of fields.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |