public class RestBindingAdvice extends Object implements CamelInternalProcessorAdvice<Map<String,Object>>
CamelInternalProcessorAdvice that binds the REST DSL incoming
and outgoing messages from sources of json or xml to Java Objects.
The binding uses DataFormat for the actual work to transform
from xml/json to Java Objects and reverse again.
The rest producer side is implemented in RestProducerBindingProcessorCamelInternalProcessor| Constructor and Description |
|---|
RestBindingAdvice(CamelContext camelContext,
DataFormat jsonDataFormat,
DataFormat xmlDataFormat,
DataFormat outJsonDataFormat,
DataFormat outXmlDataFormat,
String consumes,
String produces,
String bindingMode,
boolean skipBindingOnErrorCode,
boolean enableCORS,
Map<String,String> corsHeaders,
Map<String,String> queryDefaultValues) |
| Modifier and Type | Method and Description |
|---|---|
void |
after(Exchange exchange,
Map<String,Object> state)
Callback executed after processing a step in the route.
|
Map<String,Object> |
before(Exchange exchange)
Callback executed before processing a step in the route.
|
public RestBindingAdvice(CamelContext camelContext, DataFormat jsonDataFormat, DataFormat xmlDataFormat, DataFormat outJsonDataFormat, DataFormat outXmlDataFormat, String consumes, String produces, String bindingMode, boolean skipBindingOnErrorCode, boolean enableCORS, Map<String,String> corsHeaders, Map<String,String> queryDefaultValues) throws Exception
Exceptionpublic Map<String,Object> before(Exchange exchange) throws Exception
CamelInternalProcessorAdvicebefore in interface CamelInternalProcessorAdvice<Map<String,Object>>exchange - the current exchangeCamelInternalProcessorAdvice.after(org.apache.camel.Exchange, Object) method, or use null for no state.Exception - is thrown if error during the call.public void after(Exchange exchange, Map<String,Object> state) throws Exception
CamelInternalProcessorAdviceafter in interface CamelInternalProcessorAdvice<Map<String,Object>>exchange - the current exchangestate - the state, if any, returned in the CamelInternalProcessorAdvice.before(org.apache.camel.Exchange) method.Exception - is thrown if error during the call.Apache Camel