public void save ( ProcessingEnvironment env ) throws IOException { Filer filer = env . getFiler ( ) ; //JavaFileObject sourceFile = filer.createClassFile(getQualifiedName(), superClass); FileObject sourceFile = filer . createResource ( StandardLocation . CLASS_OUTPUT , El . getPackageOf ( this ) . getQualifiedName ( ) , getSimpleName ( ) + ".class" ) ; BufferedOutputStream bos = new BufferedOutputStream ( sourceFile . openOutputStream ( ) ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; write ( dos ) ; dos . close ( ) ; System . err . println ( "wrote " + sourceFile . getName ( ) ) ; }
Saves subclass as class file