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 StringOBJECT_FACTORYstatic StringPRETTY_PRINT
-
Constructor Summary
Constructors Constructor Description FallbackTypeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectconvertTo(Class<?> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.spi.TypeConverterRegistry registry)protected <T> JAXBContextcreateContext(Class<T> type)protected <T> UnmarshallergetUnmarshaller(Class<T> type)protected <T> booleanisJaxbType(Class<T> type, org.apache.camel.Exchange exchange, boolean objectFactory)booleanisObjectFactory()booleanisPrettyPrint()protected <T> Tmarshall(Class<T> type, org.apache.camel.Exchange exchange, Object value, org.apache.camel.TypeConverter converter, Method objectFactoryMethod, boolean prettyPrint)protected booleanneedFiltering(org.apache.camel.Exchange exchange)voidsetObjectFactory(boolean objectFactory)Whether the JAXB converter supports using ObjectFactory classes to create the POJO classes during conversion.voidsetPrettyPrint(boolean prettyPrint)Whether the JAXB converter should use pretty print or not (default is true)protected Objectunmarshal(Unmarshaller unmarshaller, org.apache.camel.Exchange exchange, Object value)protected <T> Tunmarshall(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:
JAXBExceptionFactoryConfigurationErrororg.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
-
-