public class FormulaParser
extends java.lang.Object
FormulaParser
parses formulas in formula text, extracting out
all cell references. A cell reference consists of an optional sheet name
(optionally enclosed in single quotes) followed by an exclamation ("!"),
followed by a legal cell reference (alpha-number format), optionally
followed by a default value clause, which is two pipes followed by the
default value: "||value".Constructor | Description |
---|---|
FormulaParser() |
Create a
FormulaParser . |
FormulaParser(java.lang.String formulaText) |
Create a
FormulaParser object that will parse the given
formula text. |
Modifier and Type | Method | Description |
---|---|---|
java.util.List<CellRef> |
getCellReferences() |
Returns a
List of CellRefs that this parser
found in the formula text. |
void |
parse() |
Parses the formula text.
|
void |
setCell(org.apache.poi.ss.usermodel.Cell cell) |
Sets the
Cell that contains the formula to be parsed. |
void |
setFormulaText(java.lang.String formulaText) |
Sets the formula text to the given formula text and resets the parser.
|
public FormulaParser()
FormulaParser
.public FormulaParser(java.lang.String formulaText)
FormulaParser
object that will parse the given
formula text.formulaText
- The text of the formula.public void setCell(org.apache.poi.ss.usermodel.Cell cell)
Cell
that contains the formula to be parsed.cell
- The Cell
.public void setFormulaText(java.lang.String formulaText)
formulaText
- The new formula text.public void parse()
public java.util.List<CellRef> getCellReferences()
List
of CellRefs
that this parser
found in the formula text.List
of CellRefs
, possibly empty.Copyright © 2012–2018 Jett Team. All rights reserved.