org.makumba.forms.tags
Class BasicValueTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.makumba.analyser.AnalysableElement
          extended by org.makumba.analyser.AnalysableTag
              extended by org.makumba.commons.tags.GenericMakumbaTag
                  extended by org.makumba.forms.tags.BasicValueTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Direct Known Subclasses:
InputTag, OptionTag

public abstract class BasicValueTag
extends GenericMakumbaTag

This is a a base class for InputTag and OptionTag but may be used for other tags that need to compute a value in similar manner (value="$attribute" or value="OQL expr").

Version:
$Id: BasicValueTag.java 1529 2007-09-13 23:33:10Z rosso_nero $
Author:
Cristian Bogdan, Manuel Gay
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.makumba.analyser.AnalysableElement
AnalysableElement.FilePositionElementComparator
 
Field Summary
(package private)  String dataType
           
protected  DataDefinitionProvider ddp
           
 String expr
           
protected  FormDataProvider fdp
           
(package private)  String valueExprOriginal
           
 
Fields inherited from class org.makumba.commons.tags.GenericMakumbaTag
extraFormatting, extraFormattingParams, NEEDED_RESOURCES, params
 
Fields inherited from class org.makumba.analyser.AnalysableTag
ATTRIBUTE_VALUES_TRUE_FALSE, tagData, tagKey, TYPES
 
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
BasicValueTag()
           
 
Method Summary
 String checkPtrExpr(String expr2, PageCache pageCache)
           
(package private) abstract  int computedValue(Object o, FieldDefinition type)
          A value was computed, do what's needed with it, cleanup and return the result of doMakumbaEndTag()
protected  void doAnalyzedCleanup()
          Called by doEndTag in its finally block.
 int doAnalyzedEndTag(PageCache pageCache)
          makumba-specific endTag
 void doEndAnalyze(PageCache pageCache)
          Tells the ValueComputer to finish analysis, and sets the types for var and printVar.
 void doStartAnalyze(PageCache pageCache)
          Determines the ValueComputer and associates it with the tagKey
 FormTagBase getForm()
           
(package private) abstract  FieldDefinition getTypeFromContext(PageCache pageCache)
           
protected  boolean isAttribute()
          Indicates if the given expression is an attribute
 boolean isNull()
          Indicates if the expression is null
(package private)  boolean isValue()
           
protected  boolean isValue(String exprexpression)
          Indicates if the given expression is a value
 void setValue(String value)
           
 
Methods inherited from class org.makumba.commons.tags.GenericMakumbaTag
doStartTag, getParams, initialiseState, isAttribute, setAddTitle, setCols, setDefault, setElementSeparator, setEllipsis, setEllipsisLength, setEmpty, setFormat, setHtml, setLabelSeparator, setLineSeparator, setLongLineLength, setMaxlength, setMaxLength, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setRows, setSize, setStyle, setStyleClass, setStyleId, setTitle, setType, setType, setUrlEncode, toString
 
Methods inherited from class org.makumba.analyser.AnalysableTag
addTagText, allowsIdenticalKey, canHaveBody, checkAttributeValues, doAnalyzedStartTag, doEndTag, getElementData, getPageContext, getPageTextInfo, getTagKey, getTagText, needPageCache, notEmpty, onlyInt, registerAttributeValues, registerPossibleAttributeValues, setTagDataAtAnalysis, setTagKey
 
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, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ddp

protected DataDefinitionProvider ddp

valueExprOriginal

String valueExprOriginal

dataType

String dataType

expr

public String expr

fdp

protected FormDataProvider fdp
Constructor Detail

BasicValueTag

public BasicValueTag()
Method Detail

setValue

public void setValue(String value)

getForm

public FormTagBase getForm()

isNull

public boolean isNull()
Indicates if the expression is null

Returns:
true if the expression is null, false otherwise

isValue

boolean isValue()

isValue

protected boolean isValue(String exprexpression)
Indicates if the given expression is a value

Returns:
true if the expression doesn't start with '$' and is not null, false otherwise

isAttribute

protected boolean isAttribute()
Indicates if the given expression is an attribute

Returns:
true if the expression starts with '$', false otherwise

doStartAnalyze

public void doStartAnalyze(PageCache pageCache)
Determines the ValueComputer and associates it with the tagKey

Overrides:
doStartAnalyze in class AnalysableTag
Parameters:
pageCache - the page cache of the current page

checkPtrExpr

public String checkPtrExpr(String expr2,
                           PageCache pageCache)

getTypeFromContext

abstract FieldDefinition getTypeFromContext(PageCache pageCache)

doEndAnalyze

public void doEndAnalyze(PageCache pageCache)
Tells the ValueComputer to finish analysis, and sets the types for var and printVar.

Overrides:
doEndAnalyze in class AnalysableTag
Parameters:
pageCache - the page cache of the current page

doAnalyzedEndTag

public int doAnalyzedEndTag(PageCache pageCache)
                     throws JspException,
                            LogicException
Description copied from class: AnalysableTag
makumba-specific endTag

Overrides:
doAnalyzedEndTag in class AnalysableTag
Parameters:
pageCache - The page cache for the current page
Throws:
JspException
LogicException
See Also:
AnalysableTag.doEndTag()

computedValue

abstract int computedValue(Object o,
                           FieldDefinition type)
                    throws JspException,
                           LogicException
A value was computed, do what's needed with it, cleanup and return the result of doMakumbaEndTag()

Parameters:
o - the value
type - the type of the data
Throws:
JspException
LogicException

doAnalyzedCleanup

protected void doAnalyzedCleanup()
Description copied from class: AnalysableTag
Called by doEndTag in its finally block. Use it to clean references that will not be used next time the servlet container uses the tag object.

Overrides:
doAnalyzedCleanup in class GenericMakumbaTag