org.makumba.list.functions
Class ValueFunction

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.makumba.analyser.AnalysableElement
          extended by org.makumba.analyser.AnalysableExpression
              extended by org.makumba.list.functions.GenericListValueFunction
                  extended by org.makumba.list.functions.ValueFunction
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class ValueFunction
extends GenericListValueFunction

Implements a mak:value() function, similar to the mak:value tag (ValueTag). The advantage of the function is that it can be used inside JSTL/EL statements, e.g. a c:if. The function provides just basic value computing, but not the advanced formatting that the ValueTag provides.

Version:
$Id: ValueFunction.java 5117 2010-05-18 17:18:03Z rosso_nero $
Author:
Rudolf Mayer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.makumba.analyser.AnalysableElement
AnalysableElement.FilePositionElementComparator
 
Field Summary
 
Fields inherited from class org.makumba.analyser.AnalysableExpression
elData, expression, key, parent
 
Fields inherited from class org.makumba.analyser.AnalysableElement
ANALYSIS_STATE
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ValueFunction()
           
 
Method Summary
 void analyze(PageCache pageCache)
          Performs analysis-time operations
 String getPrefix()
          Gets the prefix of the makumba EL expression, e.g.
 Object resolve(PageContext pc, PageCache pageCache)
          Resolves the expression at runtime
 String treatExpressionAtAnalysis(String expression)
          Modifies the expression before analysis.
static Object value(String expr)
           
 
Methods inherited from class org.makumba.list.functions.GenericListValueFunction
computeKey, doEndAnalyze, getEnclosingList, getRunningListKey, getValueComputer, registerValueAtParentList, setKey
 
Methods inherited from class org.makumba.analyser.AnalysableExpression
checkNumberOfArguments, findParentWithClass, getElementData, getKey, getParent, setELDataAtAnalysis, setParent, treatELExpressionAtAnalysis
 
Methods inherited from class org.makumba.analyser.AnalysableElement
checkTagFound, discardJSPParsingData, getAnalyzedElementData, getCurrentBodyTagData, getElementAfter, getElementBefore, getPageCache, getPageCache, getRunningElementData, getTagByAttribute, getTagById, getThreadElementStack, initializeThread, keepAnalysisState, setAnalyzedElementData, setRunningElementData
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFunction

public ValueFunction()
Method Detail

analyze

public void analyze(PageCache pageCache)
Description copied from class: AnalysableExpression
Performs analysis-time operations

Specified by:
analyze in class AnalysableExpression

getPrefix

public String getPrefix()
Description copied from class: AnalysableExpression
Gets the prefix of the makumba EL expression, e.g. Value

Specified by:
getPrefix in class AnalysableExpression
Returns:
the prefix of this EL expression

resolve

public Object resolve(PageContext pc,
                      PageCache pageCache)
               throws LogicException
Description copied from class: AnalysableExpression
Resolves the expression at runtime

Specified by:
resolve in class AnalysableExpression
Throws:
LogicException

treatExpressionAtAnalysis

public String treatExpressionAtAnalysis(String expression)
Description copied from class: AnalysableExpression
Modifies the expression before analysis. This is necessary because the expression that comes from page analysis is not tailored to the specific expression we want to handle

Specified by:
treatExpressionAtAnalysis in class AnalysableExpression
Returns:
the expression value, trimmed down to what is necessary for this kind of EL expression evaluator

value

public static Object value(String expr)