@Converter(generateLoader=true) public class FallbackTypeConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
OBJECT_FACTORY |
static String |
PRETTY_PRINT |
| Constructor and Description |
|---|
FallbackTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
Object |
convertTo(Class<?> type,
org.apache.camel.Exchange exchange,
Object value,
org.apache.camel.spi.TypeConverterRegistry registry) |
protected <T> JAXBContext |
createContext(Class<T> type) |
protected <T> Unmarshaller |
getUnmarshaller(Class<T> type) |
protected <T> boolean |
isJaxbType(Class<T> type,
org.apache.camel.Exchange exchange,
boolean objectFactory) |
boolean |
isObjectFactory() |
boolean |
isPrettyPrint() |
protected <T> T |
marshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value,
org.apache.camel.TypeConverter converter,
Method objectFactoryMethod,
boolean prettyPrint) |
protected boolean |
needFiltering(org.apache.camel.Exchange exchange) |
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)
|
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,
org.apache.camel.TypeConverter converter)
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)
@FallbackConverter @Converter(fallback=true) public Object convertTo(Class<?> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.spi.TypeConverterRegistry registry)
protected <T> boolean isJaxbType(Class<T> type, org.apache.camel.Exchange exchange, boolean objectFactory)
protected <T> T unmarshall(Class<T> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.TypeConverter converter) throws Exception
Exceptionprotected <T> T marshall(Class<T> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.TypeConverter converter, Method objectFactoryMethod, boolean prettyPrint) throws JAXBException, FactoryConfigurationError, org.apache.camel.TypeConversionException
JAXBExceptionFactoryConfigurationErrororg.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