Package org.apache.camel

Examples of org.apache.camel.TypeConversionException


            // error occurred during type conversion
            if (e instanceof TypeConversionException) {
                throw (TypeConversionException) e;
            } else {
                throw new TypeConversionException(value, type, e);
            }
        }
        if (answer == Void.TYPE) {
            // Could not find suitable conversion
            missCounter.incrementAndGet();
View Full Code Here


            failedCounter.incrementAndGet();
            // error occurred during type conversion
            if (e instanceof TypeConversionException) {
                throw (TypeConversionException) e;
            } else {
                throw new TypeConversionException(value, type, e);
            }
        }
        if (answer == Void.TYPE || value == null) {
            // Could not find suitable conversion
            missCounter.incrementAndGet();
View Full Code Here

            if (execution) {
                throw ObjectHelper.wrapCamelExecutionException(exchange, e);
            }

            // error occurred during type conversion
            throw new TypeConversionException(value, type, e);
        }
        if (answer == Void.TYPE) {
            // Could not find suitable conversion
            return null;
        } else {
View Full Code Here

        Object answer;
        try {
            answer = doConvertTo(type, exchange, value, false);
        } catch (Exception e) {
            // error occurred during type conversion
            throw new TypeConversionException(value, type, e);
        }
        if (answer == Void.TYPE || value == null) {
            // Could not find suitable conversion
            throw new NoTypeConversionAvailableException(value, type);
        } else {
View Full Code Here

                if (isJaxbType(value.getClass()) && isNotStreamCacheType(type)) {
                    return marshall(type, exchange, value);
                }
            }
        } catch (Exception e) {
            throw new TypeConversionException(value, type, e);
        }

        // should return null if didn't even try to convert at all or for whatever reason the conversion is failed
        return null;
    }
View Full Code Here

            // error occurred during type conversion
            if (e instanceof TypeConversionException) {
                throw (TypeConversionException) e;
            } else {
                throw new TypeConversionException(value, type, e);
            }
        }
        if (answer == Void.TYPE) {
            if (statistics.isStatisticsEnabled()) {
                missCounter.incrementAndGet();
View Full Code Here

            }
            // error occurred during type conversion
            if (e instanceof TypeConversionException) {
                throw (TypeConversionException) e;
            } else {
                throw new TypeConversionException(value, type, e);
            }
        }
        if (answer == Void.TYPE || value == null) {
            if (statistics.isStatisticsEnabled()) {
                missCounter.incrementAndGet();
View Full Code Here

        try {
            template.sendBody("direct:a", "World");
            fail("Should have thrown exception");
        } catch (CamelExecutionException e) {
            TypeConversionException cause = assertIsInstanceOf(TypeConversionException.class, e.getCause());
            assertEquals(String.class, cause.getFromType());
            assertEquals(int.class, cause.getToType());
            assertEquals("A", cause.getValue());
        }

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        try {
            template.sendBody("direct:b", "World");
            fail("Should have thrown exception");
        } catch (CamelExecutionException e) {
            TypeConversionException cause = assertIsInstanceOf(TypeConversionException.class, e.getCause());
            assertEquals(String.class, cause.getFromType());
            assertEquals(int.class, cause.getToType());
            assertEquals("true", cause.getValue());
        }

        assertMockEndpointsSatisfied();
    }
View Full Code Here

                if (isJaxbType(value.getClass()) && isNotStreamCacheType(type)) {
                    return marshall(type, exchange, value);
                }
            }
        } catch (Exception e) {
            throw new TypeConversionException(value, type, e);
        }

        // should return null if didn't even try to convert at all or for whatever reason the conversion is failed
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.TypeConversionException

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.