@Override
public void foundClass( final String packageName, final Class<?> classFound, final Method methodFound ) {
LOGGER.debug( "found annotated method: " + classFound.getName() + "." + methodFound.getName() + "()" );
RequestMethod[] methods;
final Mapping mapping = methodFound.getAnnotation( Mapping.class );
if ( mapping.value().length == 0 ) {
LOGGER.error( "Missing request URI in " + classFound.getName() + "." + methodFound.getName() + "(). Ignoring this mapping." );
return;
}
if ( mapping.method().length == 0 ) {
LOGGER.debug( "Mapping " + classFound.getName() + "." + methodFound.getName() + "() to default GET method." );
methods = new RequestMethod[] { RequestMethod.GET };
} else {
methods = mapping.method();
}
for ( final String requestUri : mapping.value() ) {
if ( !initializedControllers.containsKey( classFound.getName() ) ) {
Object controller;
try {
controller = classFound.newInstance();
} catch ( InstantiationException | IllegalAccessException e ) {