[]
FormulaSyntaxTree to a formula string.Use this context to control how FormulaSyntaxTree.toString(UnParseContext) formats references when converting a syntax tree back to text. The context can specify the formula position through 0-based base row and base column values, whether references are formatted in R1C1 style, and the culture used during conversion.
A new instance is empty and uses the invariant culture by default.
FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("OR(A1={1,3,5})");
FunctionNode functionNode = (FunctionNode) syntaxTree.getRoot();
OperatorNode operatorNode = (OperatorNode) functionNode.getChildren().get(0);
ArrayNode arrayNode = (ArrayNode) operatorNode.getChildren().get(1);
Object[][] elements = arrayNode.getElements();
elements[0][0] = 5;
elements[0][1] = 6;
elements[0][2] = 7;
UnParseContext context = new UnParseContext();
context.setIsR1C1(true);
String formulaText = syntaxTree.toString(context);
final intfinal intfinal booleanfinal voidsetBaseColumn(int value) final voidsetBaseRow(int value) final voidsetIsR1C1(boolean value) UnParseContext.This value identifies the base row used by UnParseContext when converting a FormulaSyntaxTree back to formula text. It is typically used together with getBaseColumn() for references whose text depends on the formula location, such as R1C1-style references.
UnParseContext context = new UnParseContext();
context.setBaseRow(1);
int baseRow = context.getBaseRow();
This value identifies the base row used by UnParseContext when converting a FormulaSyntaxTree back to formula text. It is typically used together with getBaseColumn() for references whose text depends on the formula location, such as R1C1-style references.
UnParseContext context = new UnParseContext();
context.setBaseRow(1);
value - The 0-based row index that represents the formula location.This value is used by UnParseContext when converting a FormulaSyntaxTree to formula text, especially for references whose text depends on the formula position, such as R1C1-style references.
UnParseContext context = new UnParseContext();
context.setBaseColumn(7);
int baseColumn = context.getBaseColumn();
This value is used by UnParseContext when converting a FormulaSyntaxTree to formula text, especially for references whose text depends on the formula position, such as R1C1-style references.
UnParseContext context = new UnParseContext();
context.setBaseColumn(7);
value - The 0-based column index that represents the formula location.
UnParseContext context = new UnParseContext();
context.setIsR1C1(true);
boolean isR1C1 = context.getIsR1C1();
Use this property when an SyntaxNode or FormulaSyntaxTree is converted to formula text through SyntaxNode.toString(UnParseContext). Set this value to true to output references in R1C1 style, or false to output references in A1 style.
UnParseContext context = new UnParseContext();
context.setIsR1C1(true);
value - true to use R1C1 reference style when converting formulas to text; false to use A1 reference style.