ThinkUI SQL Client 1.1.3 API

thinkui.parser
Class ExcelFileParser

java.lang.Object
  extended bythinkui.parser.AbstractFileParser
      extended bythinkui.parser.ExcelFileParser
All Implemented Interfaces:
thinkui.parser.FileParser

public class ExcelFileParser
extends AbstractFileParser

Parser for importing an Excel file (a single sheet) into a data class.


Constructor Summary
ExcelFileParser(ColumnParseData[] parseData)
          ExcelFileParser constructor.
 
Method Summary
static java.lang.Object evaluateAdd(org.apache.poi.hssf.record.formula.AddPtg add, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given AddPtg and return the result value.
static java.lang.Object evaluateArea(org.apache.poi.hssf.record.formula.AreaPtg ref, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given AreaPtg and return the result value.
static java.lang.Object evaluateCell(int column, int row, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Helper method to retrieve and evaluate value at the given cell location.
static java.lang.Object evaluateDivide(org.apache.poi.hssf.record.formula.DividePtg divide, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given DividePtg and return the result value.
static java.lang.Object evaluateFuncVar(org.apache.poi.hssf.record.formula.FuncVarPtg funcVar, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given FuncVarPtg and return the result value.
static java.lang.Object evaluateMultiply(org.apache.poi.hssf.record.formula.MultiplyPtg multiply, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given MultiplyPtg and return the result value.
static java.lang.Object evaluateReference(org.apache.poi.hssf.record.formula.ReferencePtg ref, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given ReferencePtg and return the result value.
static java.lang.Object evaluateSubtract(org.apache.poi.hssf.record.formula.SubtractPtg subtract, java.util.Stack stack, org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Evaluate the given SubtractPtg and return the result value.
 ColumnParseData getColumnParseData(java.lang.String attrName)
           
 ColumnParseData[] getParseData()
           
 void importData()
          Parse the file and import into the database.
 void importFile(DataClass dataClass, java.lang.String fileName, int startLine, int maxNumRecords)
          Import the data in the specified file and populate the database.
 void setParseData(ColumnParseData[] parseData)
          Sets the parse data for the parser.
 
Methods inherited from class thinkui.parser.AbstractFileParser
getCommitInterval, getDataClass, getDataObjectManager, getDefaultValues, getFile, getMaxNumRecords, getNumErrors, getNumInserts, getNumWarnings, getStartLine, getStatusInterval, incNumErrors, incNumInserts, incNumWarnings, isDryRun, setCommitInterval, setDataClass, setDataObjectManager, setDefaultValues, setDryRun, setFile, setMaxNumRecords, setStartLine, setStatusInterval
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelFileParser

public ExcelFileParser(ColumnParseData[] parseData)
ExcelFileParser constructor.

Method Detail

evaluateAdd

public static final java.lang.Object evaluateAdd(org.apache.poi.hssf.record.formula.AddPtg add,
                                                 java.util.Stack stack,
                                                 org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                          throws java.lang.Exception
Evaluate the given AddPtg and return the result value.

Throws:
java.lang.Exception

evaluateArea

public static final java.lang.Object evaluateArea(org.apache.poi.hssf.record.formula.AreaPtg ref,
                                                  java.util.Stack stack,
                                                  org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                           throws java.lang.Exception
Evaluate the given AreaPtg and return the result value.

Throws:
java.lang.Exception

evaluateCell

public static final java.lang.Object evaluateCell(int column,
                                                  int row,
                                                  org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                           throws java.lang.Exception
Helper method to retrieve and evaluate value at the given cell location.

Throws:
java.lang.Exception

evaluateDivide

public static final java.lang.Object evaluateDivide(org.apache.poi.hssf.record.formula.DividePtg divide,
                                                    java.util.Stack stack,
                                                    org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                             throws java.lang.Exception
Evaluate the given DividePtg and return the result value.

Throws:
java.lang.Exception

evaluateFuncVar

public static final java.lang.Object evaluateFuncVar(org.apache.poi.hssf.record.formula.FuncVarPtg funcVar,
                                                     java.util.Stack stack,
                                                     org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                              throws java.lang.Exception
Evaluate the given FuncVarPtg and return the result value.

Throws:
java.lang.Exception

evaluateMultiply

public static final java.lang.Object evaluateMultiply(org.apache.poi.hssf.record.formula.MultiplyPtg multiply,
                                                      java.util.Stack stack,
                                                      org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                               throws java.lang.Exception
Evaluate the given MultiplyPtg and return the result value.

Throws:
java.lang.Exception

evaluateReference

public static final java.lang.Object evaluateReference(org.apache.poi.hssf.record.formula.ReferencePtg ref,
                                                       java.util.Stack stack,
                                                       org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                                throws java.lang.Exception
Evaluate the given ReferencePtg and return the result value.

Throws:
java.lang.Exception

evaluateSubtract

public static final java.lang.Object evaluateSubtract(org.apache.poi.hssf.record.formula.SubtractPtg subtract,
                                                      java.util.Stack stack,
                                                      org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                                               throws java.lang.Exception
Evaluate the given SubtractPtg and return the result value.

Throws:
java.lang.Exception

getColumnParseData

public final ColumnParseData getColumnParseData(java.lang.String attrName)
Returns:
the column parse data for the given attribute or null.

getParseData

public final ColumnParseData[] getParseData()
Returns:
the parse data for the parser.

importData

public final void importData()
                      throws java.lang.Exception
Parse the file and import into the database.

Specified by:
importData in interface thinkui.parser.FileParser
Specified by:
importData in class AbstractFileParser
Throws:
java.lang.Exception

importFile

public final void importFile(DataClass dataClass,
                             java.lang.String fileName,
                             int startLine,
                             int maxNumRecords)
                      throws java.lang.Exception
Import the data in the specified file and populate the database. A data object manager must be already configured using the setDataObjectManager() method.

Throws:
java.lang.Exception

setParseData

public final void setParseData(ColumnParseData[] parseData)
Sets the parse data for the parser.


ThinkUI SQL Client 1.1.3 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.