01: package org.vraptor.converter;
02:
03: import org.vraptor.LogicRequest;
04:
05: /**
06: * Basic converter.
07: *
08: * @author Guilherme Silveira
09: */
10: public interface Converter {
11:
12: /**
13: * Converts a value to an specific type
14: *
15: * @param value
16: * current value
17: * @param type
18: * desired type
19: * @return the converted value
20: * @throws ConversionException
21: * some convertion problem hapenned
22: */
23: Object convert(String value, Class<?> type, LogicRequest context)
24: throws ConversionException;
25:
26: /**
27: * Returns the list of supported types
28: *
29: * @return array of supported types
30: */
31: Class<?>[] getSupportedTypes();
32:
33: }
|