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