SpecCompliantClassAP(AnnotationProcessorEnvironment env) { this.env = env; specCompliantAnnotation = (AnnotationTypeDeclaration) env .getTypeDeclaration("org.apache.vysper.compliance.SpecCompliant"); specCompliantCollectionAnnotation = (AnnotationTypeDeclaration) env .getTypeDeclaration("org.apache.vysper.compliance.SpecCompliance"); try { fileWriter = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File("spec_compliance.html"), null); } catch (IOException e) { throw new RuntimeException("could not write to output file", e); } }
public void process() { try { buf = new StringBuilder(); Messager log = env.getMessager(); DeclarationVisitor scanner = DeclarationVisitors.getDeclarationScanner( new Visitor(), DeclarationVisitors.NO_OP); for (TypeDeclaration typeDecl : env.getSpecifiedTypeDeclarations()) { typeDecl.accept(scanner); } if (buf.length() > 0) { writer = env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File("META-INF/web-types"), "UTF-8"); writer.print(buf.toString()); writer.close(); } } catch (IOException e) { e.printStackTrace(); } } }
/** * Return the writer to the specified file. * * @return The writer to the specified file. */ public PrintWriter getWriter() throws IOException, MissingParameterException { if (getName() == null) { throw new MissingParameterException("name"); } AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment(); return env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, pkg, new File(getName()), charset); }
pw = filer.createTextFile(Filer.Location.CLASS_TREE, "", servicePath, null); pw.println("# GData Kind Adaptors for " + term);
pw = filer.createTextFile(Filer.Location.CLASS_TREE, "", servicePath, null); pw.println("# GData Kind Adaptors for " + term);
pw = filer.createTextFile(Filer.Location.CLASS_TREE, "", servicePath, null); pw.println("# GData Kind Adaptors for " + term);