org.makumba.list.engine.valuecomputer
Class SetValueComputer

java.lang.Object
  extended by org.makumba.list.engine.valuecomputer.ValueComputer
      extended by org.makumba.list.engine.valuecomputer.QueryValueComputer
          extended by org.makumba.list.engine.valuecomputer.SetValueComputer

public class SetValueComputer
extends QueryValueComputer

The manager of a setValueQuery.

Author:
Cristian Bogdan

Field Summary
(package private)  String name
          If we are in a value tag, the name of the queryProjection that computes the title field, otherwise null
(package private)  int nameIndex
          If we are in a value tag, the index of the queryProjection that computes the title field, otherwise null
 
Fields inherited from class org.makumba.list.engine.valuecomputer.QueryValueComputer
dummy, queryKey
 
Fields inherited from class org.makumba.list.engine.valuecomputer.ValueComputer
expr, parentKey, projectionIndex, type
 
Constructor Summary
SetValueComputer(AnalysableTag analyzed, MultipleKey parentListKey, FieldDefinition set, String setExpr, PageCache pageCache)
          Makes a query that has an extra FROM: the set requested.
 
Method Summary
 void doEndAnalyze(PageCache pageCache)
          Computes nameIndex
 Object getValue(PageContext pageContext)
          Goes through the iterationGroupData and returns a vector with the set values.
 void print(ValueTag running, PageCache pageCache)
          Goes through the iterationGroupData and prints the set values, comma-separated; also sets var (Vector with the set values) and printVar
 
Methods inherited from class org.makumba.list.engine.valuecomputer.QueryValueComputer
getQueryKey, makeQueryAtAnalysis, runQuery
 
Methods inherited from class org.makumba.list.engine.valuecomputer.ValueComputer
getFormattedValue, getType, getValueComputerAtAnalysis, isPointer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

String name
If we are in a value tag, the name of the queryProjection that computes the title field, otherwise null


nameIndex

int nameIndex
If we are in a value tag, the index of the queryProjection that computes the title field, otherwise null

Constructor Detail

SetValueComputer

SetValueComputer(AnalysableTag analyzed,
                 MultipleKey parentListKey,
                 FieldDefinition set,
                 String setExpr,
                 PageCache pageCache)
Makes a query that has an extra FROM: the set requested. As projections, add the key of the set type and, if we are in a value tag, the title field.

Parameters:
analyzed - the tag that is analyzed
parentListKey - the key of the parent list
set - the FieldDefinition of the set we want to compute a value of
setExpr - the expression of the set
pageCache - the page cache of the current page
Method Detail

doEndAnalyze

public void doEndAnalyze(PageCache pageCache)
Computes nameIndex

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

getValue

public Object getValue(PageContext pageContext)
                throws LogicException
Goes through the iterationGroupData and returns a vector with the set values. Used only by InputTag

Overrides:
getValue in class ValueComputer
Parameters:
running - the tag that is currently running
Returns:
the computed value
Throws:
LogicException

print

public void print(ValueTag running,
                  PageCache pageCache)
           throws JspException,
                  LogicException
Goes through the iterationGroupData and prints the set values, comma-separated; also sets var (Vector with the set values) and printVar

Overrides:
print in class ValueComputer
Parameters:
running - the tag that is currently running
pageCache - the pageCache of the current page
Throws:
JspException
LogicException