View Javadoc

1   package net.sourceforge.jparam.conversion.converters;
2   
3   import net.sourceforge.jparam.conversion.weights.ScalarConversionWeight;
4   
5   public class ParentConverter extends AbstractConverter {
6   
7   	public ParentConverter(Class parent, Class child) {
8   		this.targetClass = parent;
9   		this.sourceClass = child;
10  		this.conversionWeight = ScalarConversionWeight.CONV_TO_PARENT;
11  	}
12  
13  	protected Object internalConvert(Object o) throws Exception {
14  		return o;
15  	}
16  
17  	protected boolean converterEquals(IConverter c) {
18  	    // ignore c
19  	    if (c == null){
20  	        // if all parameters of the other converter are the same, then it 
21  	        // is the same converter
22  	    }
23  
24  		return true;
25  	}
26  
27  	public IConverter update(IConverter updatedConverter) {
28  	    // ignore updatedConverter
29  	    if (updatedConverter == null){
30  	    }
31  		// this converter cannot change due to registration of new converters...
32  		return this;
33  	}
34  }