Package pt.ist.fenixWebFramework.renderers.components.converters

Examples of pt.ist.fenixWebFramework.renderers.components.converters.ConversionException


        public Object convert(Class type, Object value) {
            final String numberText = ((String) value).trim();
            try {
                return numberText.length() == 0 ? null : new Money(numberText);
            } catch (NumberFormatException e) {
                throw new ConversionException("renderers.converter.money", e, true, value);
            }
        }
View Full Code Here


            final String[] values = (String[]) value;
            for (String key : values) {
                String[] parts = key.split(",");
                if (parts.length < 3) {
                    throw new ConversionException("invalid key format: " + key);
                }

                final CurricularCourse curricularCourse = (CurricularCourse) converter.convert(type, parts[0]);
                final CurriculumGroup curriculumGroup = (CurriculumGroup) converter.convert(type, parts[1]);
                final StudentCurricularPlan studentCurricularPlan = (StudentCurricularPlan) converter.convert(type, parts[2]);
View Full Code Here

            final String[] values = (String[]) value;
            for (String key : values) {
                String[] parts = key.split(",");
                if (parts.length < 3) {
                    throw new ConversionException("invalid key format: " + key);
                }

                final OptionalCurricularCourse curricularCourse = (OptionalCurricularCourse) converter.convert(type, parts[0]);
                final CurriculumGroup curriculumGroup = (CurriculumGroup) converter.convert(type, parts[1]);
                final StudentCurricularPlan studentCurricularPlan = (StudentCurricularPlan) converter.convert(type, parts[2]);
View Full Code Here

        final List<EnroledCurriculumModuleWrapper> result = new ArrayList<EnroledCurriculumModuleWrapper>();
        final String[] values = (String[]) value;
        for (String key : values) {
            String[] parts = key.split(",");
            if (parts.length < 2) {
                throw new ConversionException("invalid key format: " + key);
            }

            final CurriculumModule curriculumModule = (CurriculumModule) converter.convert(type, parts[0]);
            final ExecutionSemester executionSemester = (ExecutionSemester) converter.convert(type, parts[1]);
            result.add(new EnroledCurriculumModuleWrapper(curriculumModule, executionSemester));
View Full Code Here

        final List<DegreeModuleToEnrol> result = new ArrayList<DegreeModuleToEnrol>();
        final String[] values = (String[]) value;
        for (String key : values) {
            String[] parts = key.split(",");
            if (parts.length < 3) {
                throw new ConversionException("invalid key format: " + key);
            }

            final Context context = (Context) converter.convert(type, parts[0]);
            final CurriculumGroup curriculumGroup = (CurriculumGroup) converter.convert(type, parts[1]);
            final ExecutionSemester executionSemester = (ExecutionSemester) converter.convert(type, parts[2]);
View Full Code Here

        final List<DegreeModuleToEnrol> result = new ArrayList<DegreeModuleToEnrol>();
        final String[] values = (String[]) value;
        for (String key : values) {
            String[] parts = key.split(",");
            if (parts.length < 3) {
                throw new ConversionException("invalid key format: " + key);
            }

            final Context context = (Context) converter.convert(type, parts[0]);
            final CurriculumGroup curriculumGroup = (CurriculumGroup) converter.convert(type, parts[1]);
            final ExecutionSemester executionSemester = (ExecutionSemester) converter.convert(type, parts[2]);
View Full Code Here

        tidy.setMessageListener(errorListener);

        Document document = tidy.parseDOM(inStream, null);

        if (errorListener.isBogus()) {
            throw new ConversionException("renderers.converter.safe.invalid");
        }

        parseDocument(outStream, tidy, document);

        try {
            return filterOutput(new String(outStream.toByteArray(), ENCODING));
        } catch (UnsupportedEncodingException e) {
            logger.error(e.getMessage(), e);
            throw new ConversionException("tidy.converter.ending.notSupported.critical");
        }
    }
View Full Code Here

            Writer writer = new OutputStreamWriter(outStream);
            writer.write(this.buffer.toString());
            writer.flush();
        } catch (IOException e) {
            logger.error(e.getMessage(), e);
            throw new ConversionException("renderers.converter.text.write");
        }
    }
View Full Code Here

        try {
            outStream.flush();
        } catch (IOException e) {
            logger.error(e.getMessage(), e);
            throw new ConversionException("renderers.converter.text.write");
        }

        return new String(outStream.toByteArray());
    }
View Full Code Here

TOP

Related Classes of pt.ist.fenixWebFramework.renderers.components.converters.ConversionException

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.