1 16 17 package org.springframework.web.servlet.handler.metadata; 18 19 import java.util.Collection ; 20 21 import org.apache.commons.attributes.AttributeIndex; 22 import org.apache.commons.attributes.Attributes; 23 24 56 public class CommonsPathMapHandlerMapping extends AbstractPathMapHandlerMapping { 57 58 63 protected Class [] getClassesWithPathMapAttributes() throws Exception { 64 AttributeIndex ai = new AttributeIndex(getClass().getClassLoader()); 65 Collection classes = ai.getClasses(PathMap.class); 66 return (Class []) classes.toArray(new Class [classes.size()]); 67 } 68 69 74 protected PathMap[] getPathMapAttributes(Class handlerClass) { 75 Collection atts = Attributes.getAttributes(handlerClass, PathMap.class); 76 return (PathMap[]) atts.toArray(new PathMap[atts.size()]); 77 } 78 79 } 80 | Popular Tags |