| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | CELL_REF_PATTERN
Matches a single cell ref with no absolute ('$') markers |
| private static final char |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | |
| public static void | appendFormat(Appendable
- sheet name will be appended here possibly with delimiting quotes out, String - sheet name rawSheetName)Convenience method for ( |
| public static void | appendFormat(Appendable
- sheet name will be appended here possibly with delimiting quotes out, String - workbook name workbookName, String - sheet name rawSheetName)Convenience method for ( |
| private static void | |
| pack-priv static boolean | cellReferenceIsWithinRange(String lettersPrefix, String numbersSuffix)
Used to decide whether sheet names like 'AB123' need delimiting due to the fact that they look like cell references. |
| public static String | Returns: the sheet name unchanged if there is no need for delimiting. Otherwise the sheet name is enclosed in single quotes ('). Any single quotes which were already present in the sheet name will be converted to double single quotes ('').Used to format sheet names as they would appear in cell formula expressions. |
| pack-priv static boolean | Returns: true if the presence of the specified character in a sheet name would
require the sheet name to be delimited in formulas. This includes every non-alphanumeric
character besides underscore '_' and dot '.'.
|
| private static boolean | |
| pack-priv static boolean | Returns: true if there is any possible ambiguity that the specified rawSheetName
could be interpreted as a valid cell name.Note - this method assumes the specified rawSheetName has only letters and digits. |
| pack-priv static boolean | Returns: true if the specified rawSheetName starts with R1C1 style cell referenceChecks if the sheet name starts with R1C1 style cell reference. |
| pack-priv static boolean | Returns: true if the given raw sheet name needs screening/delimiting, false otherwise or if the sheet name is null.the sheet name. rawSheetName)Tell if the given raw sheet name needs screening/delimiting. |
| CELL_REF_PATTERN | back to summary |
|---|---|
| private static final Pattern CELL_REF_PATTERN Matches a single cell ref with no absolute ('$') markers | |
| DELIMITER | back to summary |
|---|---|
| private static final char DELIMITER | |
| SheetNameFormatter | back to summary |
|---|---|
| private SheetNameFormatter() | |
| appendAndEscape | back to summary |
|---|---|
| pack-priv static void appendAndEscape(Appendable sb, String rawSheetName) | |
| appendFormat | back to summary |
|---|---|
| public static void appendFormat(Appendable out, String rawSheetName) Convenience method for (
| |
| appendFormat | back to summary |
|---|---|
| public static void appendFormat(Appendable out, String workbookName, String rawSheetName) Convenience method for (
| |
| appendOrREF | back to summary |
|---|---|
| private static void appendOrREF(Appendable out, String name) throws IOException | |
| cellReferenceIsWithinRange | back to summary |
|---|---|
| pack-priv static boolean cellReferenceIsWithinRange(String lettersPrefix, String numbersSuffix) Used to decide whether sheet names like 'AB123' need delimiting due to the fact that they look like cell references.
This code is currently being used for translating formulas represented with
For better or worse this implementation attempts to replicate Excel's formula renderer. Excel uses range checking on the apparent 'row' and 'column' components. Note however that the maximum sheet size varies across versions.
| |
| format | back to summary |
|---|---|
| public static String format(String rawSheetName) Used to format sheet names as they would appear in cell formula expressions.
| |
| isSpecialChar | back to summary |
|---|---|
pack-priv static boolean isSpecialChar(char ch)
| |
| nameLooksLikeBooleanLiteral | back to summary |
|---|---|
| private static boolean nameLooksLikeBooleanLiteral(String rawSheetName) | |
| nameLooksLikePlainCellReference | back to summary | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pack-priv static boolean nameLooksLikePlainCellReference(String rawSheetName) Note - this method assumes the specified rawSheetName has only letters and digits. It cannot be used to match absolute or range references (using the dollar or colon char). Some notable cases:
| ||||||||||||||||||||||||||||
| nameStartsWithR1C1CellReference | back to summary |
|---|---|
| pack-priv static boolean nameStartsWithR1C1CellReference(String rawSheetName) Checks if the sheet name starts with R1C1 style cell reference. If this is the case Excel requires the sheet name to be enclosed in single quotes.
| |
| needsDelimiting | back to summary |
|---|---|
| pack-priv static boolean needsDelimiting(String rawSheetName) Tell if the given raw sheet name needs screening/delimiting.
| |