Package reportgen.utils

Examples of reportgen.utils.ReportException


    }

    @Override
    public Class getCls()  throws ReportException {
        if(value.size() == 0) {
            throw new ReportException("Набор чисел пуст");
        }
        return Collection.class;
    }
View Full Code Here


            Context context) throws ReportException {
        super(element, context);
        try {
            value = element.getText().replaceFirst("^%(.*)%$", "$1");
        } catch (Exception ex) {
            throw new ReportException("Ошибка при распозновании константы: " + ex.getLocalizedMessage());
        }
    }
View Full Code Here

            Context context) throws ReportException {
        super(element, context);
        try {
            value = Double.parseDouble(element.getTextTrim());
        } catch (Exception ex) {
            throw new ReportException("Ошибка при распозновании константы: " + ex.getLocalizedMessage());
        }
    }
View Full Code Here


    @Override
    protected void checkArgumentsTypes(List<Class> operands) throws ReportException {
        if(!operands.get(0).equals(Boolean.class)) {
            throw new ReportException("В функции " + getTitle()
                    + " первый аргумент должен быть булевого типа");
        }

        if(!operands.get(1).equals(operands.get(2))) {
            throw new ReportException("В функции " + getTitle()
                    + " второй и третий аргументы должны быть одного типа");
        }
    }
View Full Code Here

        //condition
        MathExpressionOperand operand = args.get(0);
        Object conditionValue = operand.getValue(constants);
        if(!(conditionValue instanceof Boolean)) {
            throw new ReportException("Первый аргумент функции 'ЕСЛИ' должен быть булевого типа");
        }
       
        Boolean condition = (conditionValue == null) ? Boolean.FALSE : (Boolean) conditionValue;
        if(condition) {
            operand = args.get(1);
View Full Code Here

    protected final void checkArgumentsCount(int size) throws ReportException {
        if(size > maxArgumentCount
                || size < minArgumentCount) {
            if(minArgumentCount != maxArgumentCount) {
                throw new ReportException("Неверное число аргументов у функции " + mnemonic
                    + " . Их должно быть от " + minArgumentCount + " до " + maxArgumentCount + ".");
            } else {
                throw new ReportException("Неверное число аргументов у функции " + mnemonic
                    + " . Их должно быть " + minArgumentCount + ".");
            }
        }
    }
View Full Code Here

    }

    @Override
    public void validate() throws ReportException {
        if(property == null) {
            throw new ReportException("Не выбрано свойство объекта");
        }
    }
View Full Code Here

        for(ColRowRange r: rows.getFlat(new ArrayList<ColRowRange>())) {
            for(ColRowRange c: cols.getFlat(new ArrayList<ColRowRange>())) {
                Key key = new Key(c, r);
                if(!map.containsKey(key)) {
                    throw new ReportException("Отсутствует ячейка таблицы col:"
                            + c.getAtom() + ", row:" + r.getAtom());
                }
            }
        }
        rows.setCellContainer(this);
View Full Code Here

        colClass = null;
        String cls = null;
        try {
            cls = getStringAttribute(element, ATTR_CLASS);
            if (cls.length() == 0) {
                throw new ReportException("Не указан класс результирующей колонки");
            }
            colClass = getClass().getClassLoader().loadClass(cls);
        } catch (ClassNotFoundException ex) {
            throw new ReportException("Класс результирующей колонки имеет неизвестный тип:" + cls);
        }

        properties = new ResultColumn(element, context, colClass);

        String viewFuncVal = getStringAttribute(element, ATTR_VIEWFUNCTION, null, false);
View Full Code Here

    }

    @Override
    protected boolean checkValues(Object value, Object vectorValue) throws ReportException {
        if(!(vectorValue instanceof String)) {
            throw new ReportException("Некорректный операнд " + getTitle());
        }
        String strValue = (String) value;
        return strValue.endsWith(vectorValue.toString());
    }
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.