Package cli_fmw.delegate.report

Examples of cli_fmw.delegate.report.ReportParam


            defaultParameters = new HashMap<String, Object>();
        }
        //Создание массива тегов
        tagList = new ArrayList<CertTag>();
        for (int i = 0; i < params.size(); i++) {
            ReportParam reportParam = params.get(i);
            //обход дефолтных параметров
            if (defaultParameters.containsKey(reportParam.getRealName())) {
                continue;
            }
            Class<? extends CertTag> classByTag = CertTagFactory.getClassByTag(reportParam.getRealName());
            try {
                Constructor<? extends CertTag> constructor = classByTag.getConstructor(CertificateLocal.class, ReportParam.class, DiseaseLocal.class);
                CertTag tag = constructor.newInstance(cert, reportParam, disease);
                tagList.add(tag);
            } catch (NoSuchMethodException ex) {
View Full Code Here


    static public void checkReportCertificate(ReportLocal reportLocal) throws ClipsException {
        Map<String, Object> defaultParameters = reportLocal.getDefaultParameters();
        ArrayList<ReportParam> params = reportLocal.getParams();
        for (int i = 0; i < params.size(); i++) {
            ReportParam reportParam = params.get(i);
            //обход дефолтных параметров
            if (defaultParameters.containsKey(reportParam.getRealName())) {
                continue;
            }
            //поиск и проверка на соответствие параметра тегу
            Class<? extends CertTag> classTag = CertTagFactory.getClassByTag(reportParam.getRealName());
            if (classTag == null) {
                throw new ClipsException("В отчете найдено неверное имя параметра :\n" +
                        reportParam.getRealName());
            }
            //проверка на соответствие класса значения параметра классу возвращаемого тегом результата
            String tagClassName = null;
            try {
                tagClassName = classTag.getMethod("getValue").getReturnType().getName();
            } catch (NoSuchMethodException ex) {
                MessageBox.showExceptionAndHalt(ex);
            } catch (SecurityException ex) {
                MessageBox.showExceptionAndHalt(ex);
            }
            String paramClassName = reportParam.getParamClass();
            if (!paramClassName.equals(tagClassName)) {
                throw new ClipsException("Несоответствие класса значения параметра :\n" +
                        reportParam.getRealName() + " имеет класс " + paramClassName + "\n" +
                        "должен быть " + tagClassName);
            }
        }

    }
View Full Code Here

TOP

Related Classes of cli_fmw.delegate.report.ReportParam

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.