Examples of ReportException


Examples of reportgen.utils.ReportException

        this.cols = cols;
    }

    public QueryResults(Element element) throws ReportException {
        if(!element.getName().equals(TAG)) {
            throw new ReportException("Обнаружен некорректный элемент");
        }
        cols = SupportXMLRootImpl.getIntAttribute(element, ATTR_COLS);
        if(cols == 0) {
            throw new ReportException("Атрибут "  + ATTR_COLS + " имеет некорректное значение: " + cols);
        }

        rows = new ArrayList<ResultsRow>();
        List children = element.getChildren(ResultsRow.ROWTAG);
        for(Object child : children) {
            ResultsRow row = new ResultsRow((Element) child);
            if(row.getWidth() != cols) {
                throw new ReportException("Обнаружен некорректный элемент ResultsRow");
            }
            rows.add(row);
        }
    }
View Full Code Here

Examples of reportgen.utils.ReportException

               
                } else if (value instanceof Double) {
                    //fit, do nothing
               
                } else {
                    throw new ReportException("Невозможно инициализировать группу при рассчете среднего значения для класса "
                            + value.getClass().getSimpleName());
                }
                normalizeScaler.put(i, 1);

            } else if(clearAsis
View Full Code Here

Examples of reportgen.utils.ReportException

                if(value instanceof Long) {
                    dval = new Double(((Long) value).doubleValue());
                } else if(value instanceof Double) {
                    dval = (Double) value;
                } else {
                    throw new ReportException("Невозможно рассчитать среднее значение для класса "
                            + value.getClass().getSimpleName());
                }
                values[i] = (Double) sum(values[i], dval);

                //update scaler
View Full Code Here

Examples of reportgen.utils.ReportException

        return true;
    }

    private Object sum(Object value1, Object value2) throws ReportException {
        if(value1.getClass() != value2.getClass()) {
            throw new ReportException("Внутренняя ошибка, типы данных в разных строках результатов не совпадают");
        }
        Class cls = value1.getClass();
        if(cls.equals(Double.class)) {
            Double val = (Double)value1 + (Double)value2;
            return val;

        } else if(cls.equals(Long.class)) {
            Long val = (Long)value1 + (Long)value2;
            return val;

        } else {
            throw new ReportException("Внутренняя ошибка, неизвестный тип данных результах отчетов: " + cls.getSimpleName());               
        }          
    }
View Full Code Here

Examples of reportgen.utils.ReportException

     * @return
     * @throws beans.reportgen.ren.ReportException
     */
    private int compare(Object value1, Object value2) throws ReportException {
        if(value1.getClass() != value2.getClass()) {
            throw new ReportException("Внутренняя ошибка, типы данных в разных строках результатов не совпадают");
        }
        Class cls = value1.getClass();
        if(cls.equals(Double.class)) {
            return ((Double)value1).compareTo((Double)value2);

        } else if(cls.equals(Long.class)) {
            return ((Long)value1).compareTo((Long)value2);

        } else {
            throw new ReportException("Внутренняя ошибка, невозможно сравнить данные результов отчета: " + cls.getSimpleName());               
        }          
    }        
View Full Code Here

Examples of reportgen.utils.ReportException

            return val;
        } else if(cls.equals(Long.class)) {
            Long val = ((Long)value)/count;
            return val;
        } else {
            throw new ReportException("Внутренняя ошибка, неизвестный тип данных при нормализации результатов отчета: " + cls.getSimpleName());
        }
    }
View Full Code Here

Examples of reportgen.utils.ReportException

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

Examples of reportgen.utils.ReportException

        factory.init();
    }

    public QCore createDefaultCore(Context context) throws ReportException {
        if(lst.size() == 0) {
            throw new ReportException("Не зарегистрировано ни одного типа выборки");
        }
        return lst.get(0).getCore(context);
    }
View Full Code Here

Examples of reportgen.utils.ReportException

        return lst.get(0).getCore(context);
    }

    public QCore loadCore(Element root, Context context) throws ReportException {
        if(lst.size() == 0) {
            throw new ReportException("Не зарегистрирован ни один тип выборки");
        }
        for(CoreFactory factory: lst) {
            if(factory.getTitle().equals(root.getName())) {
                return factory.loadCore(root, context);
            }
        }
        throw new ReportException("Нeизвестный тип выборки:" + root.getName());
    }
View Full Code Here

Examples of reportgen.utils.ReportException

            Context context) throws ReportException {
        super(element, context);
        try {
            value = Long.parseLong(element.getTextTrim());
        } catch (Exception ex) {
            throw new ReportException("Ошибка при распозновании константы: " + ex.getLocalizedMessage());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.