org.jplate.kvp.parser.impl.defaults
Class DefaultKvpListBuilder<V extends KvpIfc>

java.lang.Object
  extended by org.jplate.foundation.parser.impl.AbstractJPlateListBuilder<V>
      extended by org.jplate.kvp.parser.impl.defaults.DefaultKvpListBuilder<V>
All Implemented Interfaces:
BuilderIfc<java.util.List<V>>, JPlateBuilderIfc<java.util.List<V>>, JPlateListBuilderIfc<V>, KvpBuilderIfc<java.util.List<V>>, KvpListBuilderIfc<V>

public class DefaultKvpListBuilder<V extends KvpIfc>
extends AbstractJPlateListBuilder<V>
implements KvpListBuilderIfc<V>

Default implementation of a KvpBuilderIfc. It uses DefaultKvp as its KvpIfc implementation and DefaultKvpFactory as the factory for creating DefaultKvp.

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/kvp/parser/impl/defaults/DefaultKvpListBuilder.java $
    


Field Summary
private  KvpFactoryIfc<V> _kvpFactory
          Used to create implementations of KvpIfc.
private  org.apache.commons.logging.Log _log
          Used for logging.
 
Constructor Summary
private DefaultKvpListBuilder()
          Default constructor not allowed.
  DefaultKvpListBuilder(KvpFactoryIfc<V> kvpFactory)
          This constructor sets defines list factory to use to create a collection to hold implementations of KvpIfc's.
  DefaultKvpListBuilder(KvpFactoryIfc<V> kvpFactory, ListFactoryIfc<V> listFactory)
          This constructor sets the factory to create implementations of KvpIfc as well as the list factory to use to hold the collection of KvpIfc's.
 
Method Summary
 void buildEnd(int line, int column)
          This method is called when parsing has completed.
 void buildKeyValuePair(KvpParseContextIfc parseContext)
          This method is called when key / value pairs have been parsed.
 
Methods inherited from class org.jplate.foundation.parser.impl.AbstractJPlateListBuilder
buildStart, getActualResultList, getResult, reset
 
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
buildStart
 
Methods inherited from interface org.jplate.foundation.gof.builder.BuilderIfc
getResult, reset
 

Field Detail

_log

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


_kvpFactory

private final KvpFactoryIfc<V extends KvpIfc> _kvpFactory
Used to create implementations of KvpIfc.

Constructor Detail

DefaultKvpListBuilder

public DefaultKvpListBuilder(KvpFactoryIfc<V> kvpFactory,
                             ListFactoryIfc<V> listFactory)
This constructor sets the factory to create implementations of KvpIfc as well as the list factory to use to hold the collection of KvpIfc's.

Parameters:
kvpFactory - Factory to create implementations of KvpIfc.
listFactory - Factory to create a list that will be used to hold the implementations KvpIfc

DefaultKvpListBuilder

public DefaultKvpListBuilder(KvpFactoryIfc<V> kvpFactory)
This constructor sets defines list factory to use to create a collection to hold implementations of KvpIfc's.

Parameters:
kvpFactory - Factory to create a implementations KvpIfc

DefaultKvpListBuilder

private DefaultKvpListBuilder()
Default constructor not allowed.

Throws:
java.lang.UnsupportedOperationException - if this constructor is called.
Method Detail

buildEnd

public void buildEnd(int line,
                     int column)
              throws JPlateBuildingException
This method is called when parsing has completed.

Specified by:
buildEnd in interface JPlateBuilderIfc<java.util.List<V extends KvpIfc>>
Parameters:
line - The line where parsing ended.
column - The column number where parsing ended.
Throws:
JPlateBuildingException

buildKeyValuePair

public void buildKeyValuePair(KvpParseContextIfc parseContext)
                       throws JPlateBuildingException
This method is called when key / value pairs have been parsed.

Specified by:
buildKeyValuePair in interface KvpBuilderIfc<java.util.List<V extends KvpIfc>>
Parameters:
parseContext - contains data about the parsed key/value pair.
Throws:
JPlateBuildingException - If there is a problem building the key / value pair.