net.sf.jett.tag
Class TotalTag

java.lang.Object
  extended by net.sf.jett.tag.BaseTag
      extended by net.sf.jett.tag.TotalTag
All Implemented Interfaces:
Tag

public class TotalTag
extends BaseTag

A TotalTag represents an aggregate value calculated from a List of values already exposed to the context. This uses jAgg functionality.


Attributes:

Author:
Randy Gettman

Field Summary
static java.lang.String ATTR_ITEMS
          Attribute that specifies the List of items to aggregate.
static java.lang.String ATTR_PARALLEL
          Attribute that specifies the degree of parallelism to use.
static java.lang.String ATTR_VALUE
          Attribute that specifies the aggregator to use.
 
Fields inherited from class net.sf.jett.tag.BaseTag
ATTR_ON_PROCESSED, SPEC_SEP
 
Constructor Summary
TotalTag()
           
 
Method Summary
 java.lang.String getName()
          Returns this Tag's name.
protected  java.util.List<java.lang.String> getOptionalAttributes()
          Returns a List of optional attribute names.
protected  java.util.List<java.lang.String> getRequiredAttributes()
          Returns a List of required attribute names.
 boolean process()
          Run a "group by" operation on the specified Aggregator, get the result, and set the cell value appropriately.
 void validateAttributes()
          Validates the attributes for this Tag.
 
Methods inherited from class net.sf.jett.tag.BaseTag
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setWorkbookContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_ITEMS

public static final java.lang.String ATTR_ITEMS
Attribute that specifies the List of items to aggregate.

See Also:
Constant Field Values

ATTR_VALUE

public static final java.lang.String ATTR_VALUE
Attribute that specifies the aggregator to use.

See Also:
Constant Field Values

ATTR_PARALLEL

public static final java.lang.String ATTR_PARALLEL
Attribute that specifies the degree of parallelism to use.

See Also:
Constant Field Values
Constructor Detail

TotalTag

public TotalTag()
Method Detail

getName

public java.lang.String getName()
Returns this Tag's name.

Returns:
This Tag's name.

getRequiredAttributes

protected java.util.List<java.lang.String> getRequiredAttributes()
Returns a List of required attribute names.

Overrides:
getRequiredAttributes in class BaseTag
Returns:
A List of required attribute names.

getOptionalAttributes

protected java.util.List<java.lang.String> getOptionalAttributes()
Returns a List of optional attribute names.

Overrides:
getOptionalAttributes in class BaseTag
Returns:
A List of optional attribute names.

validateAttributes

public void validateAttributes()
                        throws TagParseException
Validates the attributes for this Tag. The "items" attribute must be a List. The "parallel" attribute must be a positive integer (defaults to 1). The "value" attribute must be a valid Aggregator specification string. The "total" tag must not have a body.

Overrides:
validateAttributes in class BaseTag
Throws:
TagParseException - If the attribute values are illegal or unacceptable.

process

public boolean process()
Run a "group by" operation on the specified Aggregator, get the result, and set the cell value appropriately.

Specified by:
process in class BaseTag
Returns:
Whether the first Cell in the Block associated with this Tag was processed.


Copyright © 2012-2013 Jett Team. All Rights Reserved.