org.springframework.batch.sample.domain.multiline
Class AggregateItem<T>

java.lang.Object
  extended by org.springframework.batch.sample.domain.multiline.AggregateItem<T>

public class AggregateItem<T>
extends Object

A wrapper type for an item that is used by AggregateItemReader to identify the start and end of an aggregate record.

Author:
Dave Syer
See Also:
AggregateItemReader

Constructor Summary
AggregateItem(boolean header, boolean footer)
           
AggregateItem(T item)
           
 
Method Summary
static
<T> AggregateItem<T>
getFooter()
           
static
<T> AggregateItem<T>
getHeader()
           
 T getItem()
          Accessor for the wrapped item.
 boolean isFooter()
          Responds true if this record is a footer in an aggregate.
 boolean isHeader()
          Responds true if this record is a header in an aggregate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateItem

public AggregateItem(T item)
Parameters:
item -

AggregateItem

public AggregateItem(boolean header,
                     boolean footer)
Method Detail

getFooter

public static final <T> AggregateItem<T> getFooter()
Type Parameters:
T - the type of item nominally wrapped
Returns:
a static AggregateItem that is a footer.

getHeader

public static final <T> AggregateItem<T> getHeader()
Type Parameters:
T - the type of item nominally wrapped
Returns:
a static AggregateItem that is a header.

getItem

public T getItem()
          throws IllegalStateException
Accessor for the wrapped item.

Returns:
the wrapped item
Throws:
IllegalStateException - if called on a record for which either isHeader() or isFooter() answers true.

isFooter

public boolean isFooter()
Responds true if this record is a footer in an aggregate.

Returns:
true if this is the end of an aggregate record.

isHeader

public boolean isHeader()
Responds true if this record is a header in an aggregate.

Returns:
true if this is the beginning of an aggregate record.


Copyright © 2009 SpringSource. All Rights Reserved.