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

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

Introduction

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

Prototype

public AttributeIndex(ClassLoader cl) throws Exception 

Source Link

Document

Creates a new AttributeIndex for the given ClassLoader.

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  a2  s.  com
 */
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()]);
}