private void init(Annotation[] annotations) {

		for (Annotation annotation : annotations) {

			if (annotation instanceof RouteOrder) {
				order(((RouteOrder) annotation).value());
			}

			if (annotation instanceof Path) {
				path(((Path) annotation).value());
			}

			if (annotation instanceof Produces) {
				produces(((Produces) annotation).value());
			}

			if (annotation instanceof Consumes) {
				consumes(((Consumes) annotation).value());
			}

			if (annotation instanceof Header) {
				headers = headers(((Header) annotation).value());
			}

			if (annotation instanceof GET ||
			    annotation instanceof POST ||
			    annotation instanceof PUT ||
			    annotation instanceof DELETE ||
			    annotation instanceof HEAD ||
			    annotation instanceof OPTIONS ||
			    annotation instanceof PATCH) {
				method(annotation.annotationType().getSimpleName());
			}

			// Custom rest.vertx method, path, consumes and produces combination
			if (annotation instanceof Get ||
			    annotation instanceof Post ||
			    annotation instanceof Put ||
			    annotation instanceof Delete ||
			    annotation instanceof Head ||
			    annotation instanceof Options ||
			    annotation instanceof Patch ||
			    annotation instanceof Trace ||
			    annotation instanceof Connect) {

				method(annotation.annotationType().getSimpleName());

				// take path, consumes and produces values if given
				// we need to use proxy to get to the underlying methods
				InvocationHandler handler = Proxy.getInvocationHandler(annotation);
				try {
					path((String) handler.invoke(annotation, annotation.getClass().getMethod("value"), null));

					consumes((String[]) handler.invoke(annotation, annotation.getClass().getMethod("consumes"), null));
					produces((String[]) handler.invoke(annotation, annotation.getClass().getMethod("produces"), null));
				}
				catch (Throwable ex) {
					// should not happen ...
					log.warn("Failed to get annotation value via proxy!", ex);
				}
			}

			if (annotation instanceof javax.ws.rs.HttpMethod) {
				method(((javax.ws.rs.HttpMethod) annotation).value());
			}

			// response writer ...
			if (annotation instanceof ResponseWriter) {
				writer = ((ResponseWriter) annotation).value();
			}

			if (annotation instanceof RequestReader) {
				reader = ((RequestReader) annotation).value();
			}

			if (annotation instanceof ContextReader) {
				contextProvider = ((ContextReader)annotation).value();
			}

			if (annotation instanceof RolesAllowed) {
				permitAll = null; // override any previous definition
				roles = ((RolesAllowed) annotation).value();
			}

			if (annotation instanceof DenyAll) {
				roles = null; // override any previous definition
				permitAll = false;
			}

			if (annotation instanceof PermitAll) {
				roles = null; // override any previous definition
				permitAll = true;
			}

			if (annotation instanceof CatchWith) {
				exceptionHandlers =
					ArrayUtils.join(((CatchWith) annotation).value(), exceptionHandlers); // method handler is applied before class handler
			}

			if (annotation instanceof SuppressCheck) {
				suppressCheck = true;
			}

			if (annotation instanceof Blocking) {
				blockingOrdered = ((Blocking) annotation).value();
			}

			if (annotation instanceof Event) {
				Event event = (Event) annotation;
				addEvent(event);
			}

			if (annotation instanceof Events) {
				Events eventArray = (Events) annotation;
				if (eventArray.value().length > 0) {
					for (Event event : eventArray.value()) {
						addEvent(event);
					}
				}
			}
		}
	}
private void init ( Annotation [ ] annotations ) { for ( Annotation annotation : annotations ) { if ( annotation instanceof RouteOrder ) { order ( ( ( RouteOrder ) annotation ) . value ( ) ) ; } if ( annotation instanceof Path ) { path ( ( ( Path ) annotation ) . value ( ) ) ; } if ( annotation instanceof Produces ) { produces ( ( ( Produces ) annotation ) . value ( ) ) ; } if ( annotation instanceof Consumes ) { consumes ( ( ( Consumes ) annotation ) . value ( ) ) ; } if ( annotation instanceof Header ) { headers = headers ( ( ( Header ) annotation ) . value ( ) ) ; } if ( annotation instanceof GET || annotation instanceof POST || annotation instanceof PUT || annotation instanceof DELETE || annotation instanceof HEAD || annotation instanceof OPTIONS || annotation instanceof PATCH ) { method ( annotation . annotationType ( ) . getSimpleName ( ) ) ; } if ( annotation instanceof Get || annotation instanceof Post || annotation instanceof Put || annotation instanceof Delete || annotation instanceof Head || annotation instanceof Options || annotation instanceof Patch || annotation instanceof Trace || annotation instanceof Connect ) { method ( annotation . annotationType ( ) . getSimpleName ( ) ) ; InvocationHandler handler = Proxy . getInvocationHandler ( annotation ) ; try { path ( ( String ) handler . invoke ( annotation , annotation . getClass ( ) . getMethod ( "value" ) , null ) ) ; consumes ( ( String [ ] ) handler . invoke ( annotation , annotation . getClass ( ) . getMethod ( "consumes" ) , null ) ) ; produces ( ( String [ ] ) handler . invoke ( annotation , annotation . getClass ( ) . getMethod ( "produces" ) , null ) ) ; } catch ( Throwable ex ) { log . warn ( "Failed to get annotation value via proxy!" , ex ) ; } } if ( annotation instanceof javax . ws . rs . HttpMethod ) { method ( ( ( javax . ws . rs . HttpMethod ) annotation ) . value ( ) ) ; } if ( annotation instanceof ResponseWriter ) { writer = ( ( ResponseWriter ) annotation ) . value ( ) ; } if ( annotation instanceof RequestReader ) { reader = ( ( RequestReader ) annotation ) . value ( ) ; } if ( annotation instanceof ContextReader ) { contextProvider = ( ( ContextReader ) annotation ) . value ( ) ; } if ( annotation instanceof RolesAllowed ) { permitAll = null ; roles = ( ( RolesAllowed ) annotation ) . value ( ) ; } if ( annotation instanceof DenyAll ) { roles = null ; permitAll = false ; } if ( annotation instanceof PermitAll ) { roles = null ; permitAll = true ; } if ( annotation instanceof CatchWith ) { exceptionHandlers = ArrayUtils . join ( ( ( CatchWith ) annotation ) . value ( ) , exceptionHandlers ) ; } if ( annotation instanceof SuppressCheck ) { suppressCheck = true ; } if ( annotation instanceof Blocking ) { blockingOrdered = ( ( Blocking ) annotation ) . value ( ) ; } if ( annotation instanceof Event ) { Event event = ( Event ) annotation ; addEvent ( event ) ; } if ( annotation instanceof Events ) { Events eventArray = ( Events ) annotation ; if ( eventArray . value ( ) . length > 0 ) { for ( Event event : eventArray . value ( ) ) { addEvent ( event ) ; } } } } }
Sets path specifics

@param annotations list of method annotations