org.apache.camel.converter.jaxb
Class FallbackTypeConverter

java.lang.Object
  extended by org.apache.camel.converter.jaxb.FallbackTypeConverter
All Implemented Interfaces:
TypeConverterAware, TypeConverter

public class FallbackTypeConverter
extends Object
implements TypeConverter, TypeConverterAware

Version:
$Revision: 898640 $

Constructor Summary
FallbackTypeConverter()
           
 
Method Summary
<T> T
convertTo(Class<T> type, Exchange exchange, Object value)
           
<T> T
convertTo(Class<T> type, Object value)
           
protected
<T> JAXBContext
createContext(Class<T> type)
           
protected
<T> boolean
isJaxbType(Class<T> type)
           
 boolean isPrettyPrint()
           
<T> T
mandatoryConvertTo(Class<T> type, Exchange exchange, Object value)
           
<T> T
mandatoryConvertTo(Class<T> type, Object value)
           
protected
<T> T
marshall(Class<T> type, Exchange exchange, Object value)
           
protected  boolean needFiltering(Exchange exchange)
           
 void setPrettyPrint(boolean prettyPrint)
           
 void setTypeConverter(TypeConverter parentTypeConverter)
           
protected  Object unmarshal(Unmarshaller unmarshaller, Exchange exchange, Object value)
          Unmarshals the given value with the unmarshaller
protected
<T> T
unmarshall(Class<T> type, 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
 

Constructor Detail

FallbackTypeConverter

public FallbackTypeConverter()
Method Detail

isPrettyPrint

public boolean isPrettyPrint()

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)

setTypeConverter

public void setTypeConverter(TypeConverter parentTypeConverter)
Specified by:
setTypeConverter in interface TypeConverterAware

convertTo

public <T> T convertTo(Class<T> type,
                       Object value)
Specified by:
convertTo in interface TypeConverter

convertTo

public <T> T convertTo(Class<T> type,
                       Exchange exchange,
                       Object value)
Specified by:
convertTo in interface TypeConverter

mandatoryConvertTo

public <T> T mandatoryConvertTo(Class<T> type,
                                Object value)
                     throws NoTypeConversionAvailableException
Specified by:
mandatoryConvertTo in interface TypeConverter
Throws:
NoTypeConversionAvailableException

mandatoryConvertTo

public <T> T mandatoryConvertTo(Class<T> type,
                                Exchange exchange,
                                Object value)
                     throws NoTypeConversionAvailableException
Specified by:
mandatoryConvertTo in interface TypeConverter
Throws:
NoTypeConversionAvailableException

isJaxbType

protected <T> boolean isJaxbType(Class<T> type)

unmarshall

protected <T> T unmarshall(Class<T> type,
                           Exchange exchange,
                           Object value)
                throws Exception
Lets try parse via JAXB

Throws:
Exception

marshall

protected <T> T marshall(Class<T> type,
                         Exchange exchange,
                         Object value)
              throws JAXBException,
                     XMLStreamException,
                     FactoryConfigurationError
Throws:
JAXBException
XMLStreamException
FactoryConfigurationError

unmarshal

protected Object unmarshal(Unmarshaller unmarshaller,
                           Exchange exchange,
                           Object value)
                    throws JAXBException,
                           UnsupportedEncodingException
Unmarshals the given value with the unmarshaller

Parameters:
unmarshaller - the unmarshaller
exchange - the exchange
value - 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(Exchange exchange)

createContext

protected <T> JAXBContext createContext(Class<T> type)
                             throws JAXBException
Throws:
JAXBException


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.