01: package org.vraptor.converter.basic;
02:
03: import org.vraptor.LogicRequest;
04: import org.vraptor.converter.Converter;
05:
06: /**
07: * String converter
08: *
09: * @author Guilherme Silveira
10: */
11: public class StringConverter implements Converter {
12:
13: public Object convert(String value, Class<?> type,
14: LogicRequest context) {
15: return value;
16: }
17:
18: public boolean canConvert(Class<?> type) {
19: return type.isAssignableFrom(String.class);
20: }
21:
22: /**
23: * Returns the list of supported types
24: *
25: * @see org.vraptor.converter.Converter#getSupportedTypes()
26: */
27: public Class<?>[] getSupportedTypes() {
28: return new Class[] { String.class };
29: }
30:
31: }
|