This commit is contained in:
Keith Donald 2009-09-03 15:01:54 +00:00
parent 223e1e4522
commit ca159f6d9a
1 changed files with 15 additions and 4 deletions

View File

@ -765,7 +765,9 @@ public final class CustomPropertyEditorRegistrar implements PropertyEditorRegist
package org.springframework.core.converter;
public interface Converter<S, T> {
T convert(S source) throws Exception;
}]]>
</programlisting>
<para>
@ -785,9 +787,11 @@ public interface Converter<S, T> {
package org.springframework.core.convert.converters;
public class StringToInteger implements Converter<String, Integer> {
public Integer convert(String source) {
return Integer.valueOf(source);
}
}]]>
</programlisting>
</section>
@ -800,7 +804,9 @@ public class StringToInteger implements Converter<String, Integer> {
package org.springframework.core.converter;
public interface ConverterFactory<S, R> {
<T extends R> Converter<S, T> getConverter(Class<T> targetType);
}]]>
</programlisting>
<para>
@ -938,9 +944,11 @@ package org.springframework.ui.format;
import java.text.ParseException;
public interface Formatter<T> {
String format(T object, Locale locale);
T parse(String formatted, Locale locale) throws ParseException;
}]]>
</programlisting>
<para>
@ -1026,7 +1034,9 @@ public class Money {
package org.springframework.ui.format;
public interface AnnotationFormatterFactory<A extends Annotation, T> {
Formatter<T> getFormatter(A annotation);
}
]]>
</programlisting>
@ -1080,6 +1090,7 @@ public interface FormatterRegistry {
void add(Formatter<?> formatter);
void add(AnnotationFormatterFactory<?, ?> factory);
}]]>
</programlisting>
<para>