|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jplate.foundation.parser.impl.AbstractJPlateListBuilder<java.util.List<java.lang.String>>
org.jplate.tabular.parser.impl.defaults.DefaultTabularListBuilder
public class DefaultTabularListBuilder
Implementation of a TabularBuilderIfc that uses List to hold
rows and fields. Please note this class implements all of the builder
interfaces defined in the Tabular project. This is actually reasonable due to
all builders being of type TabularBuilderIfc. Therefore, as a simple
solution, the aforementioned interfaces are implemented here.
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/tabular/parser/impl/defaults/DefaultTabularListBuilder.java $
| Field Summary | |
|---|---|
private java.util.List<java.lang.String> |
_currentRecord
Holds the current record. |
private ListFactoryIfc<java.lang.String> |
_listRecordFactory
Factory to create. |
private org.apache.commons.logging.Log |
_log
Used for logging. |
static java.lang.String |
OMITTED_FIELD
Denotes an omitted field. |
| Constructor Summary | |
|---|---|
DefaultTabularListBuilder()
Default constructor. |
|
DefaultTabularListBuilder(ListFactoryIfc<java.util.List<java.lang.String>> listResultFactory,
ListFactoryIfc<java.lang.String> listRecordFactory)
This constructor sets the list factory used when creating results. |
|
| Method Summary | |
|---|---|
void |
buildEnd(int line,
int column)
This method is called when parsing has completed. |
void |
buildField(java.lang.String field,
int line,
int column)
This method is called when a field is encountered. |
void |
buildOmittedField(int line,
int column)
This method is called when a field is omitted. |
void |
buildQuotedField(java.lang.String field,
int line,
int column)
This method is called when a quoted field is found. |
void |
buildRecord(int line)
This method is called when a record is to be built. |
protected java.util.List<java.lang.String> |
getCurrentRecord()
Return the current record. |
| 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 |
|---|
public static final java.lang.String OMITTED_FIELD
private final transient org.apache.commons.logging.Log _log
private final ListFactoryIfc<java.lang.String> _listRecordFactory
private java.util.List<java.lang.String> _currentRecord
| Constructor Detail |
|---|
public DefaultTabularListBuilder(ListFactoryIfc<java.util.List<java.lang.String>> listResultFactory,
ListFactoryIfc<java.lang.String> listRecordFactory)
listResultFactory - The factory who creates lists to hold records.listRecordFactory - The factory who creates lists for fields.public DefaultTabularListBuilder()
UnsynchronizedLinkedListFactory to create
the list of records and fields.
| Method Detail |
|---|
protected java.util.List<java.lang.String> getCurrentRecord()
public void buildEnd(int line,
int column)
throws JPlateBuildingException
buildEnd in interface JPlateBuilderIfc<java.util.List<java.util.List<java.lang.String>>>line - The line where parsing ended.column - The column number where parsing ended.
JPlateBuildingException
public void buildRecord(int line)
throws JPlateBuildingException
buildRecord in interface TabularBuilderIfc<java.util.List<java.util.List<java.lang.String>>>line - The line number where the record was found.
JPlateBuildingException - If there is a problem building the record.
public void buildField(java.lang.String field,
int line,
int column)
throws JPlateBuildingException
buildField in interface TabularBuilderIfc<java.util.List<java.util.List<java.lang.String>>>field - The data in the field.line - The line where field starts.column - The column number where field starts.
JPlateBuildingException - If there is a problem building the field.
public void buildOmittedField(int line,
int column)
throws JPlateBuildingException
buildOmittedField in interface TabularBuilderIfc<java.util.List<java.util.List<java.lang.String>>>line - represents the line where the omitted field starts.column - represents the column where the omitted field starts.
JPlateBuildingException - if there is a problem building the omitted
field.
public void buildQuotedField(java.lang.String field,
int line,
int column)
throws JPlateBuildingException
buildQuotedField in interface CsvBuilderIfc<java.util.List<java.util.List<java.lang.String>>>field - A quoted field.line - The line where the field starts.column - The column number where the field starts.
JPlateBuildingException - If there is a problem building
field.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||