private void checkFactoryMethodArguments ( int arguments ) { for ( Method m : typeDef . getMethods ( ) ) { int a = m . getArguments ( ) != null ? m . getArguments ( ) . size ( ) : 0 ; if ( m . getName ( ) . equals ( staticFactoryMethod ) && a == arguments && m . isStatic ( ) ) { return ; } } throw new IllegalArgumentException ( "No static method found on " + typeDef . getName ( ) + " with name " + staticFactoryMethod + " and " + arguments + " arguments." ) ; }
Checks that a factory method with the required number of arguments is found .