SWS-548 - Expose suppressNamespace and suppressXSIType as properties to CastorMarshaller

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1737 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2009-08-18 10:45:20 +00:00
parent 7fb83ba297
commit 78b70dad35
3 changed files with 184 additions and 24 deletions
@@ -17,6 +17,7 @@
package org.springframework.web.servlet.mvc.annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -147,17 +148,21 @@ public class DefaultAnnotationHandlerMapping extends AbstractDetectingUrlHandler
*/
protected String[] determineUrlsForHandlerMethods(Class<?> handlerType) {
final Set<String> urls = new LinkedHashSet<String>();
ReflectionUtils.doWithMethods(handlerType, new ReflectionUtils.MethodCallback() {
public void doWith(Method method) {
RequestMapping mapping = method.getAnnotation(RequestMapping.class);
if (mapping != null) {
String[] mappedPaths = mapping.value();
for (String mappedPath : mappedPaths) {
addUrlsForPath(urls, mappedPath);
Class<?>[] handlerTypes =
Proxy.isProxyClass(handlerType) ? handlerType.getInterfaces() : new Class<?>[]{handlerType};
for (Class<?> currentHandlerType : handlerTypes) {
ReflectionUtils.doWithMethods(currentHandlerType, new ReflectionUtils.MethodCallback() {
public void doWith(Method method) {
RequestMapping mapping = AnnotationUtils.findAnnotation(method, RequestMapping.class);
if (mapping != null) {
String[] mappedPaths = mapping.value();
for (String mappedPath : mappedPaths) {
addUrlsForPath(urls, mappedPath);
}
}
}
}
});
});
}
return StringUtils.toStringArray(urls);
}