public static Class < ? > getGenClass ( Class < ? > cls ) throws ParserException { GenClassname genClassname = cls . getAnnotation ( GenClassname . class ) ; if ( genClassname == null ) { throw new IllegalArgumentException ( "@GenClassname not set in " + cls ) ; } try { return loadGenClass ( cls ) ; } catch ( ClassNotFoundException ex ) { throw new ParserException ( cls + " classes implementation class not compiled.\n" + "Possible problem with annotation processor.\n" + "Try building the whole project and check that implementation class " + genClassname . value ( ) + " exist!" ) ; /* try { GenClassCompiler pc = GenClassCompiler.compile(El.getTypeElement(cls.getCanonicalName()), null); return pc.loadDynamic(); } catch (IOException ex1) { throw new ParserException(ex1); } */ } }
Creates generated class either by using ClassLoader