Package org.grails.web.converters.exceptions

Examples of org.grails.web.converters.exceptions.ConverterException


                    ref.append("../");
                }
                attribute("ref", ref.substring(0, ref.length() - 1));
                break;
            case EXCEPTION:
                throw new ConverterException("Circular Reference detected: class " + o.getClass().getName());
            case INSERT_NULL:
                convertAnother(null);
        }
    }
View Full Code Here


        response.setContentType(GrailsWebUtil.getContentType(contentType, encoding));
        try {
            render(response.getWriter());
        }
        catch (IOException e) {
            throw new ConverterException(e);
        }
    }
View Full Code Here

    public static Object parse(String source) throws ConverterException {
        try {
            return SpringIOUtils.createXmlSlurper().parseText(source);
        }
        catch (Exception e) {
            throw new ConverterException("Error parsing XML", e);
        }
    }
View Full Code Here

        try {
            InputStreamReader reader = new InputStreamReader(is, encoding);
            return SpringIOUtils.createXmlSlurper().parse(reader);
        }
        catch (Exception e) {
            throw new ConverterException("Error parsing XML", e);
        }
    }
View Full Code Here

                request.setAttribute(CACHED_XML, xml);
            }
            return xml;
        }
        catch (IOException e) {
            throw new ConverterException("Error parsing XML", e);
        }
    }
View Full Code Here

    public static ConverterConfiguration<XML> getNamedConfig(String configName) throws ConverterException {
        ConverterConfiguration<XML> cfg = ConvertersConfigurationHolder.getNamedConverterConfiguration(
                configName, XML.class);
        if (cfg == null) {
            throw new ConverterException(String.format("Converter Configuration with name '%s' not found!", configName));
        }
        return cfg;
    }
View Full Code Here

    }

    public static void registerObjectMarshaller(ObjectMarshaller<XML> om) throws ConverterException {
        ConverterConfiguration<XML> cfg = ConvertersConfigurationHolder.getConverterConfiguration(XML.class);
        if (cfg == null) {
            throw new ConverterException("Default Configuration not found for class " + XML.class.getName());
        }
        if (!(cfg instanceof DefaultConverterConfiguration<?>)) {
            cfg = new DefaultConverterConfiguration<XML>(cfg);
            ConvertersConfigurationHolder.setDefaultConfiguration(XML.class, cfg);
        }
View Full Code Here

    }

    public static void registerObjectMarshaller(ObjectMarshaller<XML> om, int priority) throws ConverterException {
        ConverterConfiguration<XML> cfg = ConvertersConfigurationHolder.getConverterConfiguration(XML.class);
        if (cfg == null) {
            throw new ConverterException("Default Configuration not found for class " + XML.class.getName());
        }
        if (!(cfg instanceof DefaultConverterConfiguration<?>)) {
            cfg = new DefaultConverterConfiguration<XML>(cfg);
            ConvertersConfigurationHolder.setDefaultConfiguration(XML.class, cfg);
        }
View Full Code Here

        }
        catch (ConverterException ce) {
            throw ce;
        }
        catch (Exception e) {
            throw new ConverterException("Error converting Bean with class " + object.getClass().getName(), e);
        }
    }
View Full Code Here

                converter.convertAnother(result);
            }
        }
        catch(Throwable e) {
            throw e instanceof ConverterException ? (ConverterException)e :
                new ConverterException("Error invoking toJSON method of object with class " + object.getClass().getName(),e);
        }
    }
View Full Code Here

TOP

Related Classes of org.grails.web.converters.exceptions.ConverterException

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.