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: 748450 $

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()
           
protected
<T> T
marshall(Class<T> type, Object value)
           
 void setPrettyPrint(boolean prettyPrint)
           
 void setTypeConverter(TypeConverter parentTypeConverter)
           
protected  Object unmarshal(Unmarshaller unmarshaller, Object value)
          Unmarshals the given value with the unmarshaller
protected
<T> T
unmarshall(Class<T> type, 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

isJaxbType

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

unmarshall

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

Throws:
JAXBException

marshall

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

unmarshal

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

Parameters:
unmarshaller - the unmarshaller
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

createContext

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


Copyright © 2009 Apache Software Foundation. All Rights Reserved.