public class ExcelAntWorkbookUtil
extends org.apache.tools.ant.taskdefs.Typedef
| Modifier | Constructor and Description |
|---|---|
protected |
ExcelAntWorkbookUtil(String fName)
Constructs an instance using a String that contains the fully qualified
path of the Excel file.
|
protected |
ExcelAntWorkbookUtil(Workbook wb)
Constructs an instance based on a Workbook instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFunction(String name,
FreeRefFunction func)
Updates the internal HashMap of functions with instance and alias passed
in.
|
void |
addFunction(String name,
String clazzName)
Used to add a UDF to the evaluator.
|
ExcelAntEvaluationResult |
evaluateCell(String cellName,
double expectedValue,
double precision)
Uses a String in standard Excel format (SheetName!CellId) to locate a
cell and evaluate it.
|
double |
getCellAsDouble(String cellName)
Returns the value of the Cell as a double.
|
String |
getCellAsString(String cellName)
Returns a Cell as a String value.
|
protected FormulaEvaluator |
getEvaluator(String fileName)
Returns a formula evaluator that is loaded with the functions that
have been supplied.
|
String |
getFileName()
Returns the fileName that was used to initialize this instance.
|
protected UDFFinder |
getFunctions()
returns a UDFFinder that contains all of the functions added.
|
ArrayList<String> |
getSheets()
Returns the list of sheet names.
|
Workbook |
getWorkbook()
Returns the Workbook instance associated with this WorkbookUtil.
|
void |
setDateValue(String cellName,
Date date)
Utility method for setting the value of a Cell with a Date.
|
void |
setDoubleValue(String cellName,
double value)
This method uses a String in standard Excel format (SheetName!CellId) to
locate the cell and set it to the value of the double in value.
|
void |
setFormulaValue(String cellName,
String formula)
Utility method for setting the value of a Cell with a Formula.
|
void |
setStringValue(String cellName,
String value)
Utility method for setting the value of a Cell with a String.
|
addDefinition, execute, getClassname, getFile, getName, getResource, loadProperties, makeResourceFromURI, setAdapter, setAdapterClass, setAdaptTo, setAdaptToClass, setAntlib, setClassname, setFile, setFormat, setName, setOnError, setResource, setRestrictcreateClasspath, createLoader, getClasspath, getClasspathId, getLoaderId, hasCpDelegate, init, isReverseLoader, setClasspath, setClasspathRef, setLoaderRef, setReverseLoadergetAntlibClassLoader, getURI, setAntlibClassLoader, setURIbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeprotected ExcelAntWorkbookUtil(String fName)
fName - protected ExcelAntWorkbookUtil(Workbook wb)
wb - public void addFunction(String name, String clazzName) throws ClassNotFoundException, InstantiationException, IllegalAccessException
name - clazzName - ClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionprotected void addFunction(String name, FreeRefFunction func)
name - func - protected UDFFinder getFunctions()
protected FormulaEvaluator getEvaluator(String fileName)
fileName - public Workbook getWorkbook()
public String getFileName()
public void setDoubleValue(String cellName, double value)
cellName - value - public void setStringValue(String cellName, String value)
cellName - value - public void setFormulaValue(String cellName, String formula)
cellName - formula - public void setDateValue(String cellName, Date date)
cellName - date - public ExcelAntEvaluationResult evaluateCell(String cellName, double expectedValue, double precision)
cellName - expectedValue - precision - public String getCellAsString(String cellName)
cellName - public double getCellAsDouble(String cellName)
cellName - Copyright © 2020. All rights reserved.