net.sourceforge.jparam.conversion.converters
Class CreatorConverter

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

public class CreatorConverter
extends AbstractConverter


Field Summary
(package private)  ICreator conversionCreator
           
 
Fields inherited from class net.sourceforge.jparam.conversion.converters.AbstractConverter
conversionWeight, sourceClass, targetClass
 
Constructor Summary
CreatorConverter(ICreator conversionCreator)
           
 
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
 java.lang.Object internalConvert(java.lang.Object o)
          Internal conversion method, all subclasses must implement the actual conversion logic here
 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, equals, getSourceClass, getTargetClass, getWeight, hashCode, toConversionString, toString
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

conversionCreator

ICreator conversionCreator
Constructor Detail

CreatorConverter

public CreatorConverter(ICreator conversionCreator)
Parameters:
conversionConstructor -  
Method Detail

internalConvert

public java.lang.Object internalConvert(java.lang.Object o)
                                 throws java.lang.Exception
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

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

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.