org.pentaho.reporting.engine.classic.core.function
Class FormulaExpression

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.function.AbstractExpression
      extended by org.pentaho.reporting.engine.classic.core.function.FormulaExpression
All Implemented Interfaces:
Serializable, Cloneable, Expression

public final class FormulaExpression
extends AbstractExpression

The formula expression is used to evaluate a LibFormula/OpenFormula expression. There is generally no need to reference this class directly, as this expression is used automatically if a formula is specified in a element, style-expression or common expression.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
FormulaExpression()
          Default Constructor.
 
Method Summary
 String getFormula()
          Returns the formula (incuding the optional namespace) as defined by the OpenFormula standard.
 Exception getFormulaError()
           
 String getFormulaExpression()
          Returns the formula expression.
 String getFormulaNamespace()
          Returns the formula namespace.
 Expression getInstance()
          Return a completly separated copy of this function.
 Object getValue()
          Return the computed value of the formula.
 boolean isFormulaError()
           
 void setFormula(String formula)
          Defines the formula (incuding the optional namespace) as defined by the OpenFormula standard.
 
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

FormulaExpression

public FormulaExpression()
Default Constructor.

Method Detail

getFormula

public String getFormula()
Returns the formula (incuding the optional namespace) as defined by the OpenFormula standard.

Returns:
the formula as text.

getFormulaNamespace

public String getFormulaNamespace()
Returns the formula namespace. If the formula specified by the user starts with "=", then the namespace "report" is assumed.

Returns:
the namespace of the formula.

getFormulaExpression

public String getFormulaExpression()
Returns the formula expression.

Returns:
the formula expression.

setFormula

public void setFormula(String formula)
Defines the formula (incuding the optional namespace) as defined by the OpenFormula standard.

Parameters:
formula - the formula as text.

getValue

public Object getValue()
Return the computed value of the formula.

Returns:
the value of the function.

isFormulaError

public boolean isFormulaError()

getFormulaError

public Exception getFormulaError()

getInstance

public Expression getInstance()
Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.

Specified by:
getInstance in interface Expression
Overrides:
getInstance in class AbstractExpression
Returns:
a copy of this function.