forgot to commit type descriptor
This commit is contained in:
@@ -576,6 +576,9 @@ public class GenericBinder implements Binder {
|
||||
return results.size();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "[BindingResults = " + results.toString() + "]";
|
||||
}
|
||||
}
|
||||
|
||||
class InvalidFormat implements BindingResult {
|
||||
@@ -626,6 +629,11 @@ public class GenericBinder implements Binder {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getAlert().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Success implements BindingResult {
|
||||
@@ -672,6 +680,10 @@ public class GenericBinder implements Binder {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getAlert().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -747,6 +759,10 @@ public class GenericBinder implements Binder {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getAlert().toString();
|
||||
}
|
||||
|
||||
}
|
||||
static abstract class AbstractAlert implements Alert {
|
||||
|
||||
@@ -42,17 +42,18 @@ public class GenericFormatterRegistry implements FormatterRegistry {
|
||||
private Map<Class, AnnotationFormatterFactory> annotationFormatters = new HashMap<Class, AnnotationFormatterFactory>();
|
||||
|
||||
public Formatter<?> getFormatter(TypeDescriptor<?> propertyType) {
|
||||
Annotation[] annotations = propertyType.getAnnotations();
|
||||
for (Annotation a : annotations) {
|
||||
AnnotationFormatterFactory factory = annotationFormatters.get(a.annotationType());
|
||||
if (factory != null) {
|
||||
return factory.getFormatter(a);
|
||||
}
|
||||
}
|
||||
Formatter<?> formatter = typeFormatters.get(propertyType.getType());
|
||||
if (formatter != null) {
|
||||
return formatter;
|
||||
} else {
|
||||
Annotation[] annotations = propertyType.getAnnotations();
|
||||
for (Annotation a : annotations) {
|
||||
AnnotationFormatterFactory factory = annotationFormatters.get(a.annotationType());
|
||||
if (factory != null) {
|
||||
return factory.getFormatter(a);
|
||||
}
|
||||
}
|
||||
// TODO check class-level @Formatted annotation
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user