net.sf.jett.tag.TotalTag Maven / Gradle / Ivy
package net.sf.jett.tag;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import net.sf.jagg.AggregateFunction;
import net.sf.jagg.Aggregations;
import net.sf.jagg.Aggregator;
import net.sf.jagg.model.AggregateValue;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import net.sf.jett.exception.TagParseException;
import net.sf.jett.model.Block;
import net.sf.jett.transform.BlockTransformer;
import net.sf.jett.util.AttributeUtil;
import net.sf.jett.util.SheetUtil;
/**
* A TotalTag
represents an aggregate value calculated from a
* List
of values already exposed to the context. This uses
* jAgg
functionality.
*
*
Attributes:
*
* - Inherits all attributes from {@link BaseTag}.
* - items (required):
List
* - value (required):
String
* - parallel (optional):
int
*
*
* @author Randy Gettman
*/
public class TotalTag extends BaseTag
{
/**
* Attribute that specifies the List
of items to aggregate.
*/
public static final String ATTR_ITEMS = "items";
/**
* Attribute that specifies the aggregator to use.
*/
public static final String ATTR_VALUE = "value";
/**
* Attribute that specifies the degree of parallelism to use.
*/
public static final String ATTR_PARALLEL = "parallel";
private static final List REQ_ATTRS =
new ArrayList(Arrays.asList(ATTR_ITEMS, ATTR_VALUE));
private static final List OPT_ATTRS =
new ArrayList(Arrays.asList(ATTR_PARALLEL));
private List