net.sourceforge.jparam.conversion.converters
Class PathConverter

java.lang.Object
  |
  +--net.sourceforge.jparam.conversion.converters.AbstractConverter
        |
        +--net.sourceforge.jparam.conversion.converters.PathConverter
All Implemented Interfaces:
IConverter

public class PathConverter
extends AbstractConverter


Field Summary
(package private)  IConverter[] path
           
 
Fields inherited from class net.sourceforge.jparam.conversion.converters.AbstractConverter
conversionWeight, sourceClass, targetClass
 
Constructor Summary
PathConverter(IConverter[] path)
           
 
Method Summary
protected  boolean converterEquals(IConverter o)
          Tests if this converter is equal to the given converter, all validity checks of source/target/weight and class instance are performed in the equal method, the derived class can perform all casts with no verification The check must verify equality, and not similarity meaning to converters performing the same conversion with the same weight are not necesarily equal, for instance two conversion paths from the same source to the same target but not through the same types, will cause ambiguity if not equal
static IConverter createConversionPath(IConverter first, IConverter second)
           
 boolean equals(java.lang.Object o)
          Verify all trivial tests, and let subclass to specific verification only
 java.lang.Object internalConvert(java.lang.Object o)
          Internal conversion method, all subclasses must implement the actual conversion logic here
 java.lang.String toConversionString()
          Return a string representation of the conversion process only, no additional data, this output will be used when ambiguity is detected in order to give the user meaningfull error messages An ambiguity output would be:
 IConverter update(IConverter updatedConverter)
          This method is used to inform the converter of a new available converter if the new converter affects in any way on the current converter, a new converter that reflects the change should be return.
 
Methods inherited from class net.sourceforge.jparam.conversion.converters.AbstractConverter
convert, getSourceClass, getTargetClass, getWeight, hashCode, toString
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

path

IConverter[] path
Constructor Detail

PathConverter

public PathConverter(IConverter[] path)
Parameters:
path -  
Method Detail

equals

public boolean equals(java.lang.Object o)
Description copied from class: AbstractConverter
Verify all trivial tests, and let subclass to specific verification only
Overrides:
equals in class AbstractConverter
Following copied from class: net.sourceforge.jparam.conversion.converters.AbstractConverter
See Also:
Object.equals(java.lang.Object)

internalConvert

public java.lang.Object internalConvert(java.lang.Object o)
                                 throws JParamException
Description copied from class: AbstractConverter
Internal conversion method, all subclasses must implement the actual conversion logic here

No tests are needed since the given object is of the expected type

Overrides:
internalConvert in class AbstractConverter
Following copied from class: net.sourceforge.jparam.conversion.converters.AbstractConverter
Parameters:
o - An object instanceof getSourceClass
Returns:
An object instanceof getTargetClass
Throws:
java.lang.Exception - If there was an error performing the conversion

createConversionPath

public static IConverter createConversionPath(IConverter first,
                                              IConverter second)

converterEquals

protected boolean converterEquals(IConverter o)
Description copied from class: AbstractConverter
Tests if this converter is equal to the given converter, all validity checks of source/target/weight and class instance are performed in the equal method, the derived class can perform all casts with no verification The check must verify equality, and not similarity meaning to converters performing the same conversion with the same weight are not necesarily equal, for instance two conversion paths from the same source to the same target but not through the same types, will cause ambiguity if not equal
Overrides:
converterEquals in class AbstractConverter
Following copied from class: net.sourceforge.jparam.conversion.converters.AbstractConverter
Parameters:
o - A converter to check for equality
Returns:
true if the converters are equal

toConversionString

public java.lang.String toConversionString()
Description copied from interface: IConverter
Return a string representation of the conversion process only, no additional data, this output will be used when ambiguity is detected in order to give the user meaningfull error messages An ambiguity output would be:

 		duckling -> duck -> short -> int 
 		duckling -> duck -> char -> int
 

Note that there is no additional text or info here

Overrides:
toConversionString in class AbstractConverter
Following copied from interface: net.sourceforge.jparam.conversion.converters.IConverter
Returns:
a String representation of the conversion process

update

public IConverter update(IConverter updatedConverter)
Description copied from interface: IConverter
This method is used to inform the converter of a new available converter if the new converter affects in any way on the current converter, a new converter that reflects the change should be return. This will have no affect on atomic converters, but might affect compound converters (it could affect their weight, and could make them ambigous or change an ambigous converter to a valid one)
Following copied from interface: net.sourceforge.jparam.conversion.converters.IConverter
Parameters:
updatedConverter - the newly supported converter
Returns:
IConverter this if nothing changed or a new converter representing the change


Copyright © 2004 SourceForge. All Rights Reserved.