public static CtClass createClass ( String className , String [ ] interfaces ) throws Exception { if ( className == null ) { throw new NullPointerException ( "Class name cannot be null" ) ; } CtClass clazz = classPool . makeClass ( className ) ; if ( interfaces != null && interfaces . length > 0 ) { clazz . setInterfaces ( classPool . get ( interfaces ) ) ; } return clazz ; }
Creates a class with the desired name and linked to the mentioned interfaces .