org.apache.aries.blueprint.sample
Class DateTypeConverter

java.lang.Object
  extended by org.apache.aries.blueprint.sample.DateTypeConverter
All Implemented Interfaces:
Converter

public class DateTypeConverter
extends java.lang.Object
implements Converter


Constructor Summary
DateTypeConverter()
           
 
Method Summary
 boolean canConvert(java.lang.Object fromValue, ReifiedType toType)
          Return if this converter is able to convert the specified object to the specified type.
 java.lang.Object convert(java.lang.Object source, ReifiedType toType)
          Convert the specified object to an instance of the specified type.
 void setFormat(java.lang.String format)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTypeConverter

public DateTypeConverter()
Method Detail

setFormat

public void setFormat(java.lang.String format)

convert

public java.lang.Object convert(java.lang.Object source,
                                ReifiedType toType)
                         throws java.lang.Exception
Description copied from interface: Converter
Convert the specified object to an instance of the specified type.

Specified by:
convert in interface Converter
Parameters:
source - The source object s to convert.
toType - The target type T.
Returns:
An instance with a type that is assignable from targetType's raw class
Throws:
java.lang.Exception - If the conversion cannot succeed. This exception should not be thrown when the canConvert method has returned true.

canConvert

public boolean canConvert(java.lang.Object fromValue,
                          ReifiedType toType)
Description copied from interface: Converter
Return if this converter is able to convert the specified object to the specified type.

Specified by:
canConvert in interface Converter
Parameters:
fromValue - The source object s to convert.
toType - The target type T.
Returns:
true if the conversion is possible, false otherwise.


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.