Package net.ellwein.routey.annotations

Examples of net.ellwein.routey.annotations.Mapping


        @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 ) {
View Full Code Here

TOP

Related Classes of net.ellwein.routey.annotations.Mapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.