|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jplate.tabular.parser.impl.defaults.DefaultTableBuilder
public class DefaultTableBuilder
Default implementation of a tabular builder. 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/DefaultTableBuilder.java $
Field Summary | |
---|---|
private RecordIfc |
_currentRecord
Holds the current record. |
private org.apache.commons.logging.Log |
_log
Used for logging. |
private TableFactoryIfc |
_tableFactory
Factory to create tables. |
private TableIfc |
_tableResult
Holds the build result. |
Constructor Summary | |
---|---|
DefaultTableBuilder()
Default constructor. |
|
DefaultTableBuilder(TableFactoryIfc tableFactory)
This constructor sets the table 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. |
void |
buildStart()
This method is called when parsing is to begin. |
protected RecordIfc |
getCurrentRecord()
Return the current record. |
TableIfc |
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 |
Field Detail |
---|
private final transient org.apache.commons.logging.Log _log
private final TableFactoryIfc _tableFactory
private TableIfc _tableResult
private RecordIfc _currentRecord
Constructor Detail |
---|
public DefaultTableBuilder(TableFactoryIfc tableFactory)
tableFactory
- The factory who can create tables.public DefaultTableBuilder()
Method Detail |
---|
protected RecordIfc getCurrentRecord()
public TableIfc getResult()
getResult
in interface BuilderIfc<TableIfc>
public void reset()
reset
in interface BuilderIfc<TableIfc>
public void buildStart() throws JPlateBuildingException
buildStart
in interface JPlateBuilderIfc<TableIfc>
JPlateBuildingException
public void buildEnd(int line, int column) throws JPlateBuildingException
buildEnd
in interface JPlateBuilderIfc<TableIfc>
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<TableIfc>
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<TableIfc>
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<TableIfc>
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<TableIfc>
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 |