Package reportgen.utils

Examples of reportgen.utils.ReportException


    /**
     * @param value the value to set
     */
    public void setValue(Object value) throws ReportException {
        if(!this.cls.equals(value.getClass())) {
            throw new ReportException("Тип значения не соответствует заданному.");
        }
        this.value = value;
    }
View Full Code Here


        MathExpressionInlineResult loadResult = null;
        Element resultsEl = element.getChild(MathExpressionInlineResult.TAG);
        if (resultsEl != null) {
            loadResult = new MathExpressionInlineResult(resultsEl, getCoreContext());
        } else {
            throw new ReportException("Отсутствует результат подзапроса");
        }
        result = loadResult;
    }
View Full Code Here

    @Override
    public void ensureSafeRemove(Object obj2remove) throws ReportException {
        super.ensureSafeRemove(obj2remove);
        if (result.isContain(obj2remove)) {
            throw new ReportException("Нельзя удалить этот элемент, ссылка на него содержится в"
                    + " результатках подзапроса");
        }
    }
View Full Code Here

    }

    @Override
    public void validate() throws ReportException {
        if (result.isEmpty()) {
            throw new ReportException("Не выбран результат подзапроса");
        }
    }
View Full Code Here

            if (format.isEnabled()) {
                list.add(new TableProcessor(format));
            }
        }
        if (list.size() == 0) {
            throw new ReportException("Отчет не содержит таблиц расширенного формата");
        }
        return list;
    }
View Full Code Here

            String majorValue = tokenizer.nextToken();
            int res = 0;
            try {
                res = Integer.parseInt(majorValue);
            } catch(Exception ex) {
                throw new ReportException("Некорректный формат версии");
            }
            return res;
        } else if(obligate) {
            throw new ReportException("Некорректный формат версии");
        }
        return 0;
    }
View Full Code Here

            String reportXML, SubQueryLoader subQueryLoader) throws ReportException {
       
        reportXML = patch(reportXML);
        ReportVersion version = getVersion(reportXML);
        if(!version.isSupported()) {
            throw new ReportException("Неподдерживаемая версия отчета: " + version);
        }

        return new ReportQuery(parseXML(reportXML), subQueryLoader);
    }
View Full Code Here

        Document doc = null;
        try {
            doc = new SAXBuilder().build(new StringReader(reportXML));
        } catch (Exception ex) {
            System.err.println(reportXML);
            throw new ReportException("Ошибка в XML структуре отчета. ", ex);
        }
        return doc.getRootElement();
    }
View Full Code Here

    }

    public ResultColumn(Element element, Context context, Class cls) throws ReportException {
        colTitle = SupportXMLRootImpl.getStringAttribute(element, ATTR_TITLE);
        if (colTitle.length() == 0) {
            throw new ReportException("Пустой заголовок результирующей колонки");
        }

        String funcName = SupportXMLRootImpl.getStringAttribute(element, ATTR_GROUP, null, false);
        if(funcName == null) {
            function = AggregateFunction.ASIS;
View Full Code Here

    private QueryEntity(Context context, Element element,
            QueryEntity linkedEntity, ContextGroup coreContextGroup) throws ReportException {
        super(loadClass(XML.getStringAttribute(element, ATTR_CLASS)),
                XML.getStringAttribute(element, ATTR_IDENT, null, false));
        if(!element.getName().equals(TAG)) {
            throw new ReportException("Имя тега не соответствует " + TAG);
        }
        this.coreContextGroup = coreContextGroup;

        atom = new Atom(element, context);
        this.parent = linkedEntity;

        String linkageEl = XML.getStringAttribute(element, LINKAGE, null, false);
        if(linkageEl == null) {
            linkage = LinkageMode.backward;
        } else {
            try {
                linkage = LinkageMode.valueOf(linkageEl);
            } catch (IllegalArgumentException ex) {
                throw new ReportException("Неизвестное значение аттрибута " + LINKAGE);
            }
        }

        Element subentitiesRoot = element.getChild(SUBENTITY);
        if(subentitiesRoot != null) {
            List subentities = subentitiesRoot.getChildren();
            for(int i=0; i<subentities.size(); i++) {
                Element subentity = (Element) subentities.get(i);
                if(!subentity.getName().equals(TAG)) {
                    continue;
                }
                QueryEntity subren = new QueryEntity(context, subentity, this, coreContextGroup);
                if(subren.getLinkage() == null) {
                    throw new ReportException("Отсутствует аттрибут " + LINKAGE);
                }
                children.add(subren);
            }
        }
    }
View Full Code Here

TOP

Related Classes of reportgen.utils.ReportException

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.