Converter接口:
package com.smart.converter;
public interface Converter {
public Object convert( String... strValue ) throws Exception;
}
Interger类型实现:举一反三
package com.smart.converter;
import com.smart.exception.IllAugumentNumberException;
public class IntegerConverter implements Converter {
@Override
public Object convert(String... strValue) throws Exception {
if( strValue.length > 1 )
throw new IllAugumentNumberException();
return Integer.parseInt(strValue[0]);
}
}