org.apache.camel.converter.jaxb
Class FallbackTypeConverter
java.lang.Object
org.apache.camel.converter.jaxb.FallbackTypeConverter
- All Implemented Interfaces:
- org.apache.camel.spi.TypeConverterAware, org.apache.camel.TypeConverter
public class FallbackTypeConverter
- extends Object
- implements org.apache.camel.TypeConverter, org.apache.camel.spi.TypeConverterAware
- Version:
|
Method Summary |
|
convertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
|
|
convertTo(Class<T> type,
Object value)
|
protected
|
createContext(Class<T> type)
|
protected
|
isJaxbType(Class<T> type)
|
boolean |
isPrettyPrint()
|
|
mandatoryConvertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
|
|
mandatoryConvertTo(Class<T> type,
Object value)
|
protected
|
marshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
|
protected boolean |
needFiltering(org.apache.camel.Exchange exchange)
|
void |
setPrettyPrint(boolean prettyPrint)
|
void |
setTypeConverter(org.apache.camel.TypeConverter parentTypeConverter)
|
protected Object |
unmarshal(Unmarshaller unmarshaller,
org.apache.camel.Exchange exchange,
Object value)
Unmarshals the given value with the unmarshaller |
protected
|
unmarshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
Lets try parse via JAXB |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FallbackTypeConverter
public FallbackTypeConverter()
isPrettyPrint
public boolean isPrettyPrint()
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
setTypeConverter
public void setTypeConverter(org.apache.camel.TypeConverter parentTypeConverter)
- Specified by:
setTypeConverter in interface org.apache.camel.spi.TypeConverterAware
convertTo
public <T> T convertTo(Class<T> type,
Object value)
- Specified by:
convertTo in interface org.apache.camel.TypeConverter
convertTo
public <T> T convertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
- Specified by:
convertTo in interface org.apache.camel.TypeConverter
mandatoryConvertTo
public <T> T mandatoryConvertTo(Class<T> type,
Object value)
throws org.apache.camel.NoTypeConversionAvailableException
- Specified by:
mandatoryConvertTo in interface org.apache.camel.TypeConverter
- Throws:
org.apache.camel.NoTypeConversionAvailableException
mandatoryConvertTo
public <T> T mandatoryConvertTo(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
throws org.apache.camel.NoTypeConversionAvailableException
- Specified by:
mandatoryConvertTo in interface org.apache.camel.TypeConverter
- Throws:
org.apache.camel.NoTypeConversionAvailableException
isJaxbType
protected <T> boolean isJaxbType(Class<T> type)
unmarshall
protected <T> T unmarshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
throws Exception
- Lets try parse via JAXB
- Throws:
Exception
marshall
protected <T> T marshall(Class<T> type,
org.apache.camel.Exchange exchange,
Object value)
throws JAXBException,
XMLStreamException,
FactoryConfigurationError
- Throws:
JAXBException
XMLStreamException
FactoryConfigurationError
unmarshal
protected Object unmarshal(Unmarshaller unmarshaller,
org.apache.camel.Exchange exchange,
Object value)
throws JAXBException,
UnsupportedEncodingException
- Unmarshals the given value with the unmarshaller
- Parameters:
unmarshaller - the unmarshallerexchange - the exchangevalue - the stream to unmarshal (will close it after use, also if exception is thrown)
- Returns:
- the value
- Throws:
JAXBException - is thrown if an exception occur while unmarshalling
UnsupportedEncodingException
needFiltering
protected boolean needFiltering(org.apache.camel.Exchange exchange)
createContext
protected <T> JAXBContext createContext(Class<T> type)
throws JAXBException
- Throws:
JAXBException
Apache CAMEL