@Test public void should_return_sheet_names_of_multi_sheet_template() { EachCommand eachCommand = new EachCommand(); eachCommand.setMultisheet("multiSheetOutputNames"); Area areaWithMultiSheetOutputCommand = new XlsArea(new CellRef("areaWithMultiSheetOutput", 1, 1), new Size(1, 1)); AreaRef ref = new AreaRef(new CellRef("areaWithMultiSheetOutput", 1, 1), new CellRef("areaWithMultiSheetOutput", 1, 1)); areaWithMultiSheetOutputCommand.addCommand(ref, eachCommand); Area areaWithoutMultiSheetOutputCommand = new XlsArea(new CellRef("areaWithoutMultiSheetOutput", 1, 1), new Size()); List<String> sheetsNameOfMultiSheetTemplate = getSheetsNameOfMultiSheetTemplate(asList(areaWithMultiSheetOutputCommand, areaWithoutMultiSheetOutputCommand)); assertEquals(sheetsNameOfMultiSheetTemplate, singletonList("areaWithMultiSheetOutput")); }
static List<String> getSheetsNameOfMultiSheetTemplate(List<Area> areaList) { List<String> templateSheetsName = new ArrayList<>(); for (Area xlsArea : areaList) { for (Command command : xlsArea.findCommandByName("each")) { boolean isAreaHasMultiSheetAttribute = ((EachCommand) command).getMultisheet() != null && !((EachCommand) command).getMultisheet().isEmpty(); if (isAreaHasMultiSheetAttribute) { templateSheetsName.add(xlsArea.getAreaRef().getSheetName()); break; } } } return templateSheetsName; }
Util { static List<String> getSheetsNameOfMultiSheetTemplate(List<Area> areaList) { List<String> templateSheetsName = new ArrayList<>(); for (Area xlsArea : areaList) { for (Command command : xlsArea.findCommandByName("each")) { boolean isAreaHasMultiSheetAttribute = ((EachCommand) command).getMultisheet() != null && !((EachCommand) command).getMultisheet().isEmpty(); if (isAreaHasMultiSheetAttribute) { templateSheetsName.add(xlsArea.getAreaRef().getSheetName()); break; } } } return templateSheetsName; } }
Util { static List<String> getSheetsNameOfMultiSheetTemplate(List<Area> areaList) { List<String> templateSheetsName = new ArrayList<>(); for (Area xlsArea : areaList) { for (Command command : xlsArea.findCommandByName("each")) { boolean isAreaHasMultiSheetAttribute = ((EachCommand) command).getMultisheet() != null && !((EachCommand) command).getMultisheet().isEmpty(); if (isAreaHasMultiSheetAttribute) { templateSheetsName.add(xlsArea.getAreaRef().getSheetName()); break; } } } return templateSheetsName; }  }
Util { static List<String> getSheetsNameOfMultiSheetTemplate(List<Area> areaList) { List<String> templateSheetsName = new ArrayList<>(); for (Area xlsArea : areaList) { for (Command command : xlsArea.findCommandByName("each")) { boolean isAreaHasMultiSheetAttribute = ((EachCommand) command).getMultisheet() != null && !((EachCommand) command).getMultisheet().isEmpty(); if (isAreaHasMultiSheetAttribute) { templateSheetsName.add(xlsArea.getAreaRef().getSheetName()); break; } } } return templateSheetsName; }  static List<String> getFormulaCellRefs(String formula); static List<String> getJointedCellRefs(String formula); static List<String> getCellRefsFromJointedCellRef(String jointedCellRef); static boolean formulaContainsJointedCellRef(String formula); static String createTargetCellRef(List<CellRef> targetCellDataList); static String joinStrings(List<String> strings, String separator); static List<List<CellRef>> groupByRanges(List<CellRef> cellRefList, int targetRangeCount); static List<List<CellRef>> groupByColRange(List<CellRef> cellRefList); static List<List<CellRef>> groupByRowRange(List<CellRef> cellRefList); static Boolean isConditionTrue(ExpressionEvaluator evaluator, String condition, Context context); static Boolean isConditionTrue(ExpressionEvaluator evaluator, Context context); static void setObjectProperty(Object obj, String propertyName, String propertyValue, boolean ignoreNonExisting); static void setObjectProperty(Object obj, String propertyName, String propertyValue); static Object getObjectProperty(Object obj, String propertyName, boolean failSilently); static Object getObjectProperty(Object obj, String propertyName); static Collection<GroupData> groupCollection(Collection<?> collection, String groupProperty, String groupOrder); static Collection<GroupData> groupIterable(Iterable<?> iterable, String groupProperty, String groupOrder); static byte[] toByteArray(InputStream stream); static Collection<?> transformToCollectionObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context); static String sheetNameRegex(Map.Entry<CellRef, List<CellRef>> cellRefEntry); static List<CellRef> createTargetCellRefListByColumn(CellRef targetFormulaCellRef, List<CellRef> targetCells,
            List<CellRef> cellRefsToExclude); static int countOccurences(String str, char ch); static Iterable<Object> transformToIterableObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context); static String getStrictCellNameRegex(String name); }
Util { static List<String> getSheetsNameOfMultiSheetTemplate(List<Area> areaList) { List<String> templateSheetsName = new ArrayList<>(); for (Area xlsArea : areaList) { for (Command command : xlsArea.findCommandByName("each")) { boolean isAreaHasMultiSheetAttribute = ((EachCommand) command).getMultisheet() != null && !((EachCommand) command).getMultisheet().isEmpty(); if (isAreaHasMultiSheetAttribute) { templateSheetsName.add(xlsArea.getAreaRef().getSheetName()); break; } } } return templateSheetsName; }  static List<String> getFormulaCellRefs(String formula); static List<String> getJointedCellRefs(String formula); static List<String> getCellRefsFromJointedCellRef(String jointedCellRef); static boolean formulaContainsJointedCellRef(String formula); static String createTargetCellRef(List<CellRef> targetCellDataList); static String joinStrings(List<String> strings, String separator); static List<List<CellRef>> groupByRanges(List<CellRef> cellRefList, int targetRangeCount); static List<List<CellRef>> groupByColRange(List<CellRef> cellRefList); static List<List<CellRef>> groupByRowRange(List<CellRef> cellRefList); static Boolean isConditionTrue(ExpressionEvaluator evaluator, String condition, Context context); static Boolean isConditionTrue(ExpressionEvaluator evaluator, Context context); static void setObjectProperty(Object obj, String propertyName, String propertyValue, boolean ignoreNonExisting); static void setObjectProperty(Object obj, String propertyName, String propertyValue); static Object getObjectProperty(Object obj, String propertyName, boolean failSilently); static Object getObjectProperty(Object obj, String propertyName); static Collection<GroupData> groupCollection(Collection<?> collection, String groupProperty, String groupOrder); static Collection<GroupData> groupIterable(Iterable<?> iterable, String groupProperty, String groupOrder); static byte[] toByteArray(InputStream stream); static Collection<?> transformToCollectionObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context); static String sheetNameRegex(Map.Entry<CellRef, List<CellRef>> cellRefEntry); static List<CellRef> createTargetCellRefListByColumn(CellRef targetFormulaCellRef, List<CellRef> targetCells,
            List<CellRef> cellRefsToExclude); static int countOccurences(String str, char ch); static Iterable<Object> transformToIterableObject(ExpressionEvaluator expressionEvaluator, String collectionName, Context context); static String getStrictCellNameRegex(String name); static final String regexJointedLookBehind; static final String regexSimpleCellRef; static final String regexCellRef; static final String regexAreaRef; static final Pattern regexAreaRefPattern; static final String regexCellRefExcludingJointed; static final String regexJointedCellRef; static final String regexExcludePrefixSymbols; }