Example usage for org.apache.commons.attributes AttributeIndex getClasses

List of usage examples for org.apache.commons.attributes AttributeIndex getClasses

Introduction

In this page you can find the example usage for org.apache.commons.attributes AttributeIndex getClasses.

Prototype

public Collection getClasses(Class attributeClass) 

Source Link

Document

Gets a Collection of the Classes that have an attribute of the specified class.

Usage

From source file:org.springframework.web.servlet.handler.metadata.CommonsPathMapHandlerMapping.java

/**
 * Use Commons Attributes AttributeIndex to get a Collection of Class
 * objects with the required PathMap attribute. Protected so that it can
 * be overridden during testing.//from  w  w w  .  j  a  v a 2 s. c  om
 */
protected Class[] getClassesWithPathMapAttributes() throws Exception {
    AttributeIndex ai = new AttributeIndex(getClass().getClassLoader());
    Collection classes = ai.getClasses(PathMap.class);
    return (Class[]) classes.toArray(new Class[classes.size()]);
}