public class FallbackTypeConverter
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.TypeConverter, org.apache.camel.spi.TypeConverterAware, org.apache.camel.CamelContextAware
| Modifier and Type | Field and Description |
|---|---|
static String |
OBJECT_FACTORY |
static String |
PRETTY_PRINT |
| Constructor and Description |
|---|
FallbackTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowNull() |
<T> T |
convertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value) |
<T> T |
convertTo(Class<T> type,
Object value) |
protected <T> JAXBContext |
createContext(Class<T> type) |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
protected <T> Unmarshaller |
getUnmarshaller(Class<T> type) |
protected <T> boolean |
isJaxbType(Class<T> type) |
boolean |
isObjectFactory() |
boolean |
isPrettyPrint() |
<T> T |
mandatoryConvertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value) |
<T> T |
mandatoryConvertTo(Class<T> type,
Object value) |
protected <T> T |
marshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value,
Method objectFactoryMethod) |
protected boolean |
needFiltering(org.apache.camel.Exchange exchange) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setObjectFactory(boolean objectFactory)
Whether the JAXB converter supports using ObjectFactory classes to create the POJO classes during conversion.
|
void |
setPrettyPrint(boolean prettyPrint)
Whether the JAXB converter should use pretty print or not (default is true)
|
void |
setTypeConverter(org.apache.camel.TypeConverter parentTypeConverter) |
<T> T |
tryConvertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value) |
<T> T |
tryConvertTo(Class<T> type,
Object value) |
protected Object |
unmarshal(Unmarshaller unmarshaller,
org.apache.camel.Exchange exchange,
Object value) |
protected <T> T |
unmarshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
Lets try parse via JAXB
|
public static final String PRETTY_PRINT
public static final String OBJECT_FACTORY
public boolean isPrettyPrint()
public void setPrettyPrint(boolean prettyPrint)
public boolean isObjectFactory()
public void setObjectFactory(boolean objectFactory)
public boolean allowNull()
allowNull in interface org.apache.camel.TypeConverterpublic void setTypeConverter(org.apache.camel.TypeConverter parentTypeConverter)
setTypeConverter in interface org.apache.camel.spi.TypeConverterAwarepublic org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.CamelContextAwarepublic void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext in interface org.apache.camel.CamelContextAwarepublic <T> T convertTo(Class<T> type, Object value)
convertTo in interface org.apache.camel.TypeConverterpublic <T> T convertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
convertTo in interface org.apache.camel.TypeConverterpublic <T> T mandatoryConvertTo(Class<T> type, Object value) throws org.apache.camel.NoTypeConversionAvailableException
mandatoryConvertTo in interface org.apache.camel.TypeConverterorg.apache.camel.NoTypeConversionAvailableExceptionpublic <T> T mandatoryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value) throws org.apache.camel.NoTypeConversionAvailableException
mandatoryConvertTo in interface org.apache.camel.TypeConverterorg.apache.camel.NoTypeConversionAvailableExceptionpublic <T> T tryConvertTo(Class<T> type, Object value)
tryConvertTo in interface org.apache.camel.TypeConverterpublic <T> T tryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
tryConvertTo in interface org.apache.camel.TypeConverterprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.ServiceSupportExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.ServiceSupportExceptionprotected <T> boolean isJaxbType(Class<T> type)
protected <T> T unmarshall(Class<T> type, org.apache.camel.Exchange exchange, Object value) throws Exception
Exceptionprotected <T> T marshall(Class<T> type, org.apache.camel.Exchange exchange, Object value, Method objectFactoryMethod) throws JAXBException, XMLStreamException, FactoryConfigurationError, org.apache.camel.TypeConversionException
JAXBExceptionXMLStreamExceptionFactoryConfigurationErrororg.apache.camel.TypeConversionExceptionprotected Object unmarshal(Unmarshaller unmarshaller, org.apache.camel.Exchange exchange, Object value) throws JAXBException, UnsupportedEncodingException, XMLStreamException
protected boolean needFiltering(org.apache.camel.Exchange exchange)
protected <T> JAXBContext createContext(Class<T> type) throws JAXBException
JAXBExceptionprotected <T> Unmarshaller getUnmarshaller(Class<T> type) throws JAXBException
JAXBExceptionApache Camel