|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.util.ExchangeHelper
public class ExchangeHelper
Some helper methods for working with Exchange objects
| Method Summary | ||
|---|---|---|
static
|
convertToMandatoryType(Exchange exchange,
Class<T> type,
Object value)
Converts the value to the given expected type or throws an exception |
|
static
|
convertToType(Exchange exchange,
Class<T> type,
Object value)
Converts the value to the given expected type returning null if it could not be converted |
|
static
|
getMandatoryInBody(Exchange exchange,
Class<T> type)
Returns the mandatory inbound message body of the correct type or throws an exception if it is not present |
|
static
|
getMandatoryProperty(Exchange exchange,
String propertyName,
Class<T> type)
|
|
static
|
resolveEndpoint(E exchange,
Object value)
Attempts to resolve the endpoint for the given value |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <E extends Exchange> Endpoint<E> resolveEndpoint(E exchange,
Object value)
throws NoSuchEndpointException
exchange - the message exchange being processedvalue - the value which can be an Endpoint or an object
which provides a String representation of an endpoint via
Object.toString()
NoSuchEndpointException - if the endpoint cannot be resolved
public static <T> T getMandatoryProperty(Exchange exchange,
String propertyName,
Class<T> type)
throws NoSuchPropertyException
NoSuchPropertyException
public static <T> T getMandatoryInBody(Exchange exchange,
Class<T> type)
throws InvalidPayloadException
InvalidPayloadException
public static <T> T convertToMandatoryType(Exchange exchange,
Class<T> type,
Object value)
throws InvalidTypeException
InvalidTypeException
public static <T> T convertToType(Exchange exchange,
Class<T> type,
Object value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||