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.TypeConverter
public void setTypeConverter(org.apache.camel.TypeConverter parentTypeConverter)
setTypeConverter
in interface org.apache.camel.spi.TypeConverterAware
public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public <T> T convertTo(Class<T> type, Object value)
convertTo
in interface org.apache.camel.TypeConverter
public <T> T convertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
convertTo
in interface org.apache.camel.TypeConverter
public <T> T mandatoryConvertTo(Class<T> type, Object value) throws org.apache.camel.NoTypeConversionAvailableException
mandatoryConvertTo
in interface org.apache.camel.TypeConverter
org.apache.camel.NoTypeConversionAvailableException
public <T> T mandatoryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value) throws org.apache.camel.NoTypeConversionAvailableException
mandatoryConvertTo
in interface org.apache.camel.TypeConverter
org.apache.camel.NoTypeConversionAvailableException
public <T> T tryConvertTo(Class<T> type, Object value)
tryConvertTo
in interface org.apache.camel.TypeConverter
public <T> T tryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
tryConvertTo
in interface org.apache.camel.TypeConverter
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.ServiceSupport
Exception
protected <T> boolean isJaxbType(Class<T> type)
protected <T> T unmarshall(Class<T> type, org.apache.camel.Exchange exchange, Object value) throws Exception
Exception
protected <T> T marshall(Class<T> type, org.apache.camel.Exchange exchange, Object value, Method objectFactoryMethod) throws JAXBException, XMLStreamException, FactoryConfigurationError, org.apache.camel.TypeConversionException
JAXBException
XMLStreamException
FactoryConfigurationError
org.apache.camel.TypeConversionException
protected 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
JAXBException
protected <T> Unmarshaller getUnmarshaller(Class<T> type) throws JAXBException
JAXBException
Apache Camel