public Collection<com.sun.mirror.declaration.Declaration> getDeclarationsAnnotatedWith(AnnotationTypeDeclaration a) { return delegate.getDeclarationsAnnotatedWith(a); }
public void process() { Collection<Declaration> declarations = env.getDeclarationsAnnotatedWith(specCompliantAnnotation); System.out.println("number of solitairy @SpecCompliant: " + declarations.size()); for (Declaration declaration : declarations) { .getDeclarationsAnnotatedWith(specCompliantCollectionAnnotation); System.out.println("number of @SpecCompliance: " + moreDeclarations.size()); for (Declaration declaration : moreDeclarations) {
public void process() { PotentialThreatVisitor visitor = new PotentialThreatVisitor(); for (AnnotationTypeDeclaration atd : atds) { env.getMessager().printNotice("Collecting annotation "+atd); Collection<Declaration> decls = env.getDeclarationsAnnotatedWith(atd); for (Declaration decl : decls) { decl.accept(DeclarationVisitors.getDeclarationScanner(visitor, DeclarationVisitors.NO_OP)); } } try { visitor.print(); } catch (Exception e) { e.printStackTrace(); } }
public void process() { PotentialThreatVisitor visitor = new PotentialThreatVisitor(); for (AnnotationTypeDeclaration atd : atds) { env.getMessager().printNotice("Collecting annotation "+atd); Collection<Declaration> decls = env.getDeclarationsAnnotatedWith(atd); for (Declaration decl : decls) { decl.accept(DeclarationVisitors.getDeclarationScanner(visitor, DeclarationVisitors.NO_OP)); } } try { visitor.print(); } catch (Exception e) { e.printStackTrace(); } }
public void process() { SanityRuleVisitor visitor = new SanityRuleVisitor(); for ( AnnotationTypeDeclaration atd : atds ) { env.getMessager().printNotice( "Collecting annotation " + atd ); Collection<Declaration> decls = env.getDeclarationsAnnotatedWith( atd ); for ( Declaration decl : decls ) { decl.accept( DeclarationVisitors.getDeclarationScanner( visitor, DeclarationVisitors.NO_OP ) ); } } List<DeclaredRule> rules = visitor.getRules(); try { File targetDir = createTargetDir(); File targetFile = new File( targetDir, DeclaredRuleManager.RULES_XML_PATH ); targetFile.getParentFile().mkdirs(); env.getMessager().printNotice( "Writing " + rules.size() + " sanity rules to: " + targetFile ); Writer writer = new FileWriter( targetFile ); DeclaredRules jaxbRules = new DeclaredRules(); jaxbRules.getDeclaredRules().addAll( rules ); DeclaredRuleManager.writeRulesXml( jaxbRules, writer ); writer.close(); } catch ( Exception e ) { e.printStackTrace(); throw new SanityRuleException( e ); } }
public void process() { File targetDir = createTargetDir(); for (AnnotationTypeDeclaration atd : atds) { env.getMessager().printNotice("Processing annotation " + atd); Collection<Declaration> decls = env.getDeclarationsAnnotatedWith(atd); for (Declaration decl : decls) { MockableVisitor visitor = new MockableVisitor(env, targetDir); decl.accept(DeclarationVisitors.getDeclarationScanner(visitor, DeclarationVisitors.NO_OP)); try { visitor.generateMock(); } catch (Exception e) { e.printStackTrace(); } } } }
for (Declaration decl : env.getDeclarationsAnnotatedWith(kindDecl)) {
for (Declaration decl : env.getDeclarationsAnnotatedWith(kindDecl)) {
for (Declaration decl : env.getDeclarationsAnnotatedWith(kindDecl)) {
public void process() { PrintWriter outJAXB = openClassFile( "Jaxb" ); PrintWriter outJSON = openClassFile( "Json" ); PrintWriter outXML = openClassFile( "Xml" ); if ( outJAXB == null && outJSON == null && outXML == null ) { return; } final AnnotationTypeDeclaration annotationType = (AnnotationTypeDeclaration) processingEnv.getTypeDeclaration( "com.google.code.facebookapi.FacebookReturnType" ); Collection<Declaration> elements = processingEnv.getDeclarationsAnnotatedWith( annotationType ); AnnotationVisitor visitor = new AnnotationVisitor( outJAXB, outJSON, outXML ); for ( Declaration element : elements ) { element.accept( visitor ); } closeClassFile( outJAXB ); closeClassFile( outJSON ); closeClassFile( outXML ); }