public class Util extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
regexAreaRef |
static Pattern |
regexAreaRefPattern |
static String |
regexCellRef |
static String |
regexCellRefExcludingJointed |
static String |
regexExcludePrefixSymbols |
static String |
regexJointedCellRef |
static String |
regexJointedLookBehind |
static String |
regexSimpleCellRef |
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static int |
countOccurences(String str,
char ch) |
static String |
createTargetCellRef(List<CellRef> targetCellDataList) |
static List<CellRef> |
createTargetCellRefListByColumn(CellRef targetFormulaCellRef,
List<CellRef> targetCells,
List<CellRef> cellRefsToExclude) |
static boolean |
formulaContainsJointedCellRef(String formula) |
static List<String> |
getCellRefsFromJointedCellRef(String jointedCellRef)
Parses a "jointed cell" reference and extracts individual cell references
|
static List<String> |
getFormulaCellRefs(String formula)
Parses a formula and returns a list of cell names used in it
E.g.
|
static List<String> |
getJointedCellRefs(String formula)
Parses a formula to extract a list of so called "jointed cells"
The jointed cells are cells combined with a special notation "U_(cell1, cell2)" into a single cell
They are used in formulas like this "$[SUM(U_(F8,F13))]".
|
static Object |
getObjectProperty(Object obj,
String propertyName) |
static Object |
getObjectProperty(Object obj,
String propertyName,
boolean failSilently) |
static String |
getStrictCellNameRegex(String name) |
static List<List<CellRef>> |
groupByColRange(List<CellRef> cellRefList) |
static List<List<CellRef>> |
groupByRanges(List<CellRef> cellRefList,
int targetRangeCount)
Groups a list of cell references into a list ranges which can be used in a formula substitution
|
static List<List<CellRef>> |
groupByRowRange(List<CellRef> cellRefList) |
static Collection<GroupData> |
groupCollection(Collection<?> collection,
String groupProperty,
String groupOrder) |
static Collection<GroupData> |
groupIterable(Iterable<?> iterable,
String groupProperty,
String groupOrder) |
static Boolean |
isConditionTrue(ExpressionEvaluator evaluator,
Context context) |
static Boolean |
isConditionTrue(ExpressionEvaluator evaluator,
String condition,
Context context) |
static String |
joinStrings(List<String> strings,
String separator) |
static void |
setObjectProperty(Object obj,
String propertyName,
String propertyValue) |
static void |
setObjectProperty(Object obj,
String propertyName,
String propertyValue,
boolean ignoreNonExisting) |
static String |
sheetNameRegex(Map.Entry<CellRef,List<CellRef>> cellRefEntry) |
static byte[] |
toByteArray(InputStream stream)
Reads all the data from the input stream, and returns the bytes read.
|
static Collection<?> |
transformToCollectionObject(ExpressionEvaluator expressionEvaluator,
String collectionName,
Context context) |
static Iterable<Object> |
transformToIterableObject(ExpressionEvaluator expressionEvaluator,
String collectionName,
Context context) |
public static final String regexJointedLookBehind
public static final String regexSimpleCellRef
public static final String regexCellRef
public static final String regexAreaRef
public static final Pattern regexAreaRefPattern
public static final String regexCellRefExcludingJointed
public static final String regexJointedCellRef
public static final String regexExcludePrefixSymbols
public static List<String> getFormulaCellRefs(String formula)
formula - stringpublic static List<String> getJointedCellRefs(String formula)
formula - a formula string to parsepublic static List<String> getCellRefsFromJointedCellRef(String jointedCellRef)
jointedCellRef - a jointed cell reference to parsepublic static boolean formulaContainsJointedCellRef(String formula)
public static List<List<CellRef>> groupByRanges(List<CellRef> cellRefList, int targetRangeCount)
cellRefList - a list of cell referencestargetRangeCount - a number of ranges to use when groupingpublic static Boolean isConditionTrue(ExpressionEvaluator evaluator, String condition, Context context)
public static Boolean isConditionTrue(ExpressionEvaluator evaluator, Context context)
public static void setObjectProperty(Object obj, String propertyName, String propertyValue, boolean ignoreNonExisting)
public static void setObjectProperty(Object obj, String propertyName, String propertyValue) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
public static Object getObjectProperty(Object obj, String propertyName, boolean failSilently)
public static Object getObjectProperty(Object obj, String propertyName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
public static Collection<GroupData> groupCollection(Collection<?> collection, String groupProperty, String groupOrder)
public static Collection<GroupData> groupIterable(Iterable<?> iterable, String groupProperty, String groupOrder)
public static byte[] toByteArray(InputStream stream) throws IOException
stream - -IOException - -public static Collection<?> transformToCollectionObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context)
public static List<CellRef> createTargetCellRefListByColumn(CellRef targetFormulaCellRef, List<CellRef> targetCells, List<CellRef> cellRefsToExclude)
public static int countOccurences(String str, char ch)
public static Iterable<Object> transformToIterableObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context)
Copyright © 2019. All rights reserved.