org.jplate.foundation.parser.impl
Class AbstractJPlateListBuilder<V>

java.lang.Object
  extended by org.jplate.foundation.parser.impl.AbstractJPlateListBuilder<V>
Type Parameters:
V - The value type that will be stored in a List.
All Implemented Interfaces:
BuilderIfc<java.util.List<V>>, JPlateBuilderIfc<java.util.List<V>>, JPlateListBuilderIfc<V>
Direct Known Subclasses:
DefaultKvpListBuilder, DefaultTabularListBuilder

public abstract class AbstractJPlateListBuilder<V>
extends java.lang.Object
implements JPlateListBuilderIfc<V>

Abstract JPlate builder of List's. Please note: getResult() returns an unmodifiable list. Additionally, subclasses are left to figure out what buildEnd() does as a builder may be building information that will need to be processes at the end of a parse.

Modifications:
    $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $
    $Revision: 479 $
    $Author: sfloess $
    $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/parser/impl/AbstractJPlateListBuilder.java $
    


Field Summary
private  org.apache.commons.logging.Log _log
          Used for logging.
private  java.util.List<V> _resultList
          The list to hold KVP objects parsed.
 
Constructor Summary
AbstractJPlateListBuilder()
          Default constructor.
AbstractJPlateListBuilder(ListFactoryIfc<V> listFactory)
          This constructor sets the factory used to hold the collection of V's.
 
Method Summary
 void buildStart()
          This method is called when parsing is to begin.
protected  java.util.List<V> getActualResultList()
          This method returns the actual result and is available to subclasses.
 java.util.List<V> getResult()
          Return the built object.
 void reset()
          Reset any result currently held.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jplate.foundation.parser.JPlateBuilderIfc
buildEnd
 

Field Detail

_log

private final transient org.apache.commons.logging.Log _log
Used for logging.


_resultList

private final java.util.List<V> _resultList
The list to hold KVP objects parsed.

Constructor Detail

AbstractJPlateListBuilder

public AbstractJPlateListBuilder(ListFactoryIfc<V> listFactory)
This constructor sets the factory used to hold the collection of V's.

Parameters:
listFactory - Factory to create a list that will be used to hold the implementations V

AbstractJPlateListBuilder

public AbstractJPlateListBuilder()
Default constructor. Uses a UnsynchronizedLinkedListFactory to create the list to hold the result.

Method Detail

getResult

public java.util.List<V> getResult()
Return the built object.

Specified by:
getResult in interface BuilderIfc<java.util.List<V>>
Returns:
the built object.

reset

public void reset()
Reset any result currently held.

Specified by:
reset in interface BuilderIfc<java.util.List<V>>

buildStart

public void buildStart()
                throws JPlateBuildingException
This method is called when parsing is to begin.

Specified by:
buildStart in interface JPlateBuilderIfc<java.util.List<V>>
Throws:
JPlateBuildingException

getActualResultList

protected java.util.List<V> getActualResultList()
This method returns the actual result and is available to subclasses.

Returns:
The actual result.