org.oddjob.arooa.convert
Interface ConversionPath<F,T>

All Known Implementing Classes:
DefaultConversionPath

public interface ConversionPath<F,T>

A ConversionPath is a number of ConversionSteps from an Object of one class to an Object of another.

Author:
rob

Method Summary
<X> ConversionPath<F,X>
append(ConversionStep<T,X> following)
          Create a new ConversionPath by adding the given ConversionStep.
 boolean contains(Class<?> from)
          Test if this ConversionPath contains a conversion from the given Class.
 T convert(F from, ArooaConverter converter)
           
 Class<F> getFromClass()
          Get the from Class of this ConversionPath.
<X,Y> ConversionStep<X,Y>
getStep(int index)
          Get the conversion step for the given index.
 Class<T> getToClass()
          Get the to Class of this ConversionPath.
 int length()
          Get the number of Steps in this ConversionPath.
<X> ConversionPath<X,T>
prepend(ConversionStep<X,F> preceeding)
          Create a new ConversionPath by prepending the given ConversionStep.
 

Method Detail

append

<X> ConversionPath<F,X> append(ConversionStep<T,X> following)
Create a new ConversionPath by adding the given ConversionStep.

Parameters:
following -
Returns:

prepend

<X> ConversionPath<X,T> prepend(ConversionStep<X,F> preceeding)
Create a new ConversionPath by prepending the given ConversionStep.

Parameters:
preceeding -
Returns:

getFromClass

Class<F> getFromClass()
Get the from Class of this ConversionPath.

Returns:

getToClass

Class<T> getToClass()
Get the to Class of this ConversionPath.

Returns:

length

int length()
Get the number of Steps in this ConversionPath.

Returns:

getStep

<X,Y> ConversionStep<X,Y> getStep(int index)
Get the conversion step for the given index.

Parameters:
index - The index.
Returns:
A ConversionStep.

contains

boolean contains(Class<?> from)
Test if this ConversionPath contains a conversion from the given Class.

Parameters:
from -
Returns:

convert

T convert(F from,
          ArooaConverter converter)
          throws ConversionFailedException
Parameters:
from -
Returns:
Throws:
ConversionFailedException