Package org.apache.camel

Examples of org.apache.camel.NoTypeConversionAvailableException


                return (T) convertTo(primitiveType, exchange, value);
            }
        }

        // Could not find suitable conversion
        throw new NoTypeConversionAvailableException(value, type);
    }
View Full Code Here


                public Object evaluate(Exchange exchange) {
                    Object answer = exchange.getIn().getBody(type);
                    if (answer == null) {
                        Object defaultValue = exchange.getIn().getBody();
                        if (defaultValue != null) {
                            throw new NoTypeConversionAvailableException(defaultValue, type);
                        }

                        // if we don't have a body then
                        // lets instantiate and inject a new instance
                        answer = exchange.getContext().getInjector().newInstance(type);
View Full Code Here

        } else if (answer == null) {
            // there was a type, and we could not convert to it, then fail
            if (cause != null) {
                throw cause;
            } else {
                throw new NoTypeConversionAvailableException(body, type);
            }
        }

        return answer;
    }
View Full Code Here

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

        ObjectHelper.notNull(camelContext, "CamelContext of Exchange");
        TypeConverter converter = camelContext.getTypeConverter();
        if (converter != null) {
            return converter.mandatoryConvertTo(type, exchange, value);
        }
        throw new NoTypeConversionAvailableException(value, type);
    }
View Full Code Here

                    }
                }

                if (source == null) {
                    // indicate it was not possible to convert to a Source type
                    throw new NoTypeConversionAvailableException(body, Source.class);
                }

                DocumentInfo doc = getStaticQueryContext().buildDocument(source);
                dynamicQueryContext.setContextItem(doc);
            } finally {
View Full Code Here

        ObjectHelper.notNull(camelContext, "CamelContext of Exchange");
        TypeConverter converter = camelContext.getTypeConverter();
        if (converter != null) {
            return converter.mandatoryConvertTo(type, exchange, value);
        }
        throw new NoTypeConversionAvailableException(value, type);
    }
View Full Code Here

                    }
                }

                if (source == null) {
                    // indicate it was not possible to convert to a Source type
                    throw new NoTypeConversionAvailableException(body, Source.class);
                }

                DocumentInfo doc = config.buildDocument(source);
                dynamicQueryContext.setContextItem(doc);
            } finally {
View Full Code Here

        } else if (answer == null) {
            // there was a type, and we could not convert to it, then fail
            if (cause != null) {
                throw cause;
            } else {
                throw new NoTypeConversionAvailableException(body, type);
            }
        }

        return answer;
    }
View Full Code Here

        }
        if (answer == Void.TYPE || value == null) {
            // Could not find suitable conversion
            missCounter.incrementAndGet();
            // Could not find suitable conversion
            throw new NoTypeConversionAvailableException(value, type);
        } else {
            hitCounter.incrementAndGet();
            return (T) answer;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.NoTypeConversionAvailableException

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.