Package org.orcateam.report.exception

Examples of org.orcateam.report.exception.OrcaExpressionInvalidFormatException


                // if the paragraph text matches with our table meta tag
                // we will render the next table
                if (isNextOrcaTable(element)) {
                    // TODO exceptions need to be specified
                    if (!bodyIterator.hasNext()) {
                        throw new OrcaExpressionInvalidFormatException();
                    }
                    IBodyElement tableElement = bodyIterator.next();
                    if (!bodyIterator.hasNext()) {
                        throw new OrcaExpressionInvalidFormatException();
                    }
                    IBodyElement tableEnd = bodyIterator.next();
                    if (!isOrcaTableEnd(tableEnd)) {
                        throw new OrcaExpressionInvalidFormatException();
                    }
                    DocXTableRenderer tableRenderer = new DocXTableRenderer(tableElement, this, element, context);
                    tableRenderer.render();
                    // we need to iterate each cell only if it has table
                    for (XWPFTableRow row : ((XWPFTable) tableElement).getRows()) {
                        for (XWPFTableCell cell : row.getTableCells()) {
                            int rowindex = ((XWPFTable) tableElement).getRows().indexOf(row);
                            int colindex = row.getTableCells().indexOf(cell);
                            Map<String, Object> cellContext = tableRenderer.getCellContext(rowindex, colindex);
                            renderBody(cell, cellContext);
                        }
                    }
                    // we are adding the position of table meta tag paragraph for remove
                    removingBodyElements.add(body.getBodyElements().indexOf(element));
                    // we are adding the position of table end meta tag paragraph for remove
                    removingBodyElements.add(body.getBodyElements().indexOf(tableEnd));
                } else if (isRenderedElement(element)) {
                    if (!bodyIterator.hasNext()) {
                        throw new OrcaExpressionInvalidFormatException();
                    }
                    removingBodyElements.add(body.getBodyElements().indexOf(element));
                    Boolean isRendered = RenderedUtil.checkRendered(((XWPFParagraph) element).getParagraphText(), this, context);
                    isRendered = isRendered == null ? false : isRendered;
                    Integer indexOfEL = body.getBodyElements().indexOf(element);
View Full Code Here


                }
            }

            if (!isRendered) {
                if (!bodyIterator.hasNext()) {
                    throw new OrcaExpressionInvalidFormatException();
                }
                removingBodyElements.add(body.getBodyElements().indexOf(element));
                bodyIterator.next();
            }
        }
        throw new OrcaExpressionInvalidFormatException();
    }
View Full Code Here

     * @throws Exception
     */
    public static Boolean checkRendered(String metaText, OrcaReport orcaReport, Map<String, Object> elementContext) throws Exception {
        List<OrcaReportMetadata> metadataList = MetadataUtil.parse(metaText);
        if (metadataList.size() != 1) {
            throw new OrcaExpressionInvalidFormatException();
        }
        OrcaReportMetadata metadata = metadataList.get(0);
        return (Boolean) ELUtil.invoke(metadata.getValue(), mergeContext(orcaReport, elementContext));
    }
View Full Code Here

TOP

Related Classes of org.orcateam.report.exception.OrcaExpressionInvalidFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.