org.apache.camel.converter.jaxb
Class FallbackTypeConverter

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.converter.jaxb.FallbackTypeConverter
All Implemented Interfaces:
org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.TypeConverterAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService, org.apache.camel.TypeConverter

public class FallbackTypeConverter
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.TypeConverter, org.apache.camel.spi.TypeConverterAware

Version:

Field Summary
static String PRETTY_PRINT
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
FallbackTypeConverter()
           
 
Method Summary
 boolean allowNull()
           
<T> T
convertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
           
<T> T
convertTo(Class<T> type, Object value)
           
protected
<T> JAXBContext
createContext(Class<T> type)
           
protected  void doStart()
           
protected  void doStop()
           
protected
<T> Unmarshaller
getUnmarshaller(Class<T> type)
           
protected
<T> boolean
isJaxbType(Class<T> type)
           
 boolean isPrettyPrint()
           
<T> T
mandatoryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
           
<T> T
mandatoryConvertTo(Class<T> type, Object value)
           
protected
<T> T
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)
           
<T> T
tryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
           
<T> T
tryConvertTo(Class<T> type, Object value)
           
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)
          Lets try parse via JAXB
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRETTY_PRINT

public static final String PRETTY_PRINT
See Also:
Constant Field Values
Constructor Detail

FallbackTypeConverter

public FallbackTypeConverter()
Method Detail

isPrettyPrint

public boolean isPrettyPrint()

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)

allowNull

public boolean allowNull()
Specified by:
allowNull in interface org.apache.camel.TypeConverter

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

tryConvertTo

public <T> T tryConvertTo(Class<T> type,
                          Object value)
Specified by:
tryConvertTo in interface org.apache.camel.TypeConverter

tryConvertTo

public <T> T tryConvertTo(Class<T> type,
                          org.apache.camel.Exchange exchange,
                          Object value)
Specified by:
tryConvertTo in interface org.apache.camel.TypeConverter

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class org.apache.camel.support.ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class org.apache.camel.support.ServiceSupport
Throws:
Exception

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,
                     org.apache.camel.TypeConversionException
Throws:
JAXBException
XMLStreamException
FactoryConfigurationError
org.apache.camel.TypeConversionException

unmarshal

protected Object unmarshal(Unmarshaller unmarshaller,
                           org.apache.camel.Exchange exchange,
                           Object value)
                    throws JAXBException,
                           UnsupportedEncodingException,
                           XMLStreamException
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


Apache Camel