public Reflector create ( Object ... args ) throws ReflectException { Class < ? > [ ] types = getTypes ( args ) ; try { Constructor < ? > constructor = type ( ) . getDeclaredConstructor ( types ) ; return with ( constructor , args ) ; } catch ( NoSuchMethodException e ) { for ( Constructor < ? > constructor : type ( ) . getDeclaredConstructors ( ) ) { if ( match ( constructor . getParameterTypes ( ) , types ) ) { return with ( constructor , args ) ; } } throw new ReflectException ( e ) ; } }
We can create class by args structural parameters