Package org.apache.camel.converter.jaxb
Class FallbackTypeConverter
- java.lang.Object
-
- org.apache.camel.converter.jaxb.FallbackTypeConverter
-
@Converter(generateLoader=true) public class FallbackTypeConverter extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
OBJECT_FACTORY
static String
PRETTY_PRINT
-
Constructor Summary
Constructors Constructor Description FallbackTypeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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
-
-
-
Field Detail
-
PRETTY_PRINT
public static final String PRETTY_PRINT
- See Also:
- Constant Field Values
-
OBJECT_FACTORY
public static final String OBJECT_FACTORY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isPrettyPrint
public boolean isPrettyPrint()
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
Whether the JAXB converter should use pretty print or not (default is true)
-
isObjectFactory
public boolean isObjectFactory()
-
setObjectFactory
public void setObjectFactory(boolean objectFactory)
Whether the JAXB converter supports using ObjectFactory classes to create the POJO classes during conversion. This only applies to POJO classes that has not been annotated with JAXB and providing jaxb.index descriptor files.
-
convertTo
@FallbackConverter @Converter(fallback=true) public Object convertTo(Class<?> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.spi.TypeConverterRegistry registry)
-
isJaxbType
protected <T> boolean isJaxbType(Class<T> type, org.apache.camel.Exchange exchange, boolean objectFactory)
-
unmarshall
protected <T> T unmarshall(Class<T> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.TypeConverter converter) throws Exception
Lets try parse via JAXB- Throws:
Exception
-
marshall
protected <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
- Throws:
JAXBException
FactoryConfigurationError
org.apache.camel.TypeConversionException
-
unmarshal
protected Object unmarshal(Unmarshaller unmarshaller, org.apache.camel.Exchange exchange, Object value) throws JAXBException, UnsupportedEncodingException, XMLStreamException
-
needFiltering
protected boolean needFiltering(org.apache.camel.Exchange exchange)
-
createContext
protected <T> JAXBContext createContext(Class<T> type) throws JAXBException
- Throws:
JAXBException
-
getUnmarshaller
protected <T> Unmarshaller getUnmarshaller(Class<T> type) throws JAXBException
- Throws:
JAXBException
-
-