public static ResourceConstructor constructor ( Class < ? > annotatedResourceClass ) { Constructor constructor = PickConstructor . pickPerRequestConstructor ( annotatedResourceClass ) ; if ( constructor == null ) { throw new RuntimeException ( "Could not find constructor for class: " + annotatedResourceClass . getName ( ) ) ; } ResourceConstructorBuilder builder = rootResource ( annotatedResourceClass ) . constructor ( constructor ) ; if ( constructor . getParameterTypes ( ) != null ) { for ( int i = 0 ; i < constructor . getParameterTypes ( ) . length ; i ++ ) builder . param ( i ) . fromAnnotations ( ) ; } return builder . buildConstructor ( ) . buildClass ( ) . getConstructor ( ) ; }
Picks a constructor from an annotated resource class based on spec rules