@Test public void testDocProcessor() throws Exception { final String[] args = { "-i", "src/test/resources/src/DocTest.java", "-o", "target/spooned/", "-c" }; final Launcher launcher = new Launcher(); launcher.setArgs(args); launcher.run(); final Factory factory = launcher.getFactory(); final ProcessingManager processingManager = new QueueProcessingManager(factory); final DocProcessor processor = new DocProcessor(); processingManager.addProcessor(processor); processingManager.process(factory.Class().getAll()); assertThat(processor.undocumentedElements.size(), is(4)); }
public void process(CtElement element) { if (element instanceof CtType || element instanceof CtField || element instanceof CtExecutable) { Set<ModifierKind> modifiers = ((CtModifiable) element).getModifiers(); if (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)) { String docComment = element.getDocComment(); if (docComment == null || docComment.equals("")) { System.out.println("undocumented element at " + element.getPosition()); undocumentedElements.add(element); } } } }
DocProcessor extends AbstractProcessor<CtElement> { public void process(CtElement element) { if (element instanceof CtType || element instanceof CtField || element instanceof CtExecutable) { Set<ModifierKind> modifiers = ((CtModifiable) element).getModifiers(); if (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)) { String docComment = element.getDocComment(); if (docComment == null || docComment.equals("")) { System.out.println("undocumented element at " + element.getPosition()); undocumentedElements.add(element); } } } } }
DocProcessor extends AbstractProcessor<CtElement> { public void process(CtElement element) { if (element instanceof CtType || element instanceof CtField || element instanceof CtExecutable) { Set<ModifierKind> modifiers = ((CtModifiable) element).getModifiers(); if (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)) { String docComment = element.getDocComment(); if (docComment == null || docComment.equals("")) { System.out.println("undocumented element at " + element.getPosition()); undocumentedElements.add(element); } } } }  }
DocProcessor extends AbstractProcessor<CtElement> { public void process(CtElement element) { if (element instanceof CtType || element instanceof CtField || element instanceof CtExecutable) { Set<ModifierKind> modifiers = ((CtModifiable) element).getModifiers(); if (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)) { String docComment = element.getDocComment(); if (docComment == null || docComment.equals("")) { System.out.println("undocumented element at " + element.getPosition()); undocumentedElements.add(element); } } } }  void process(CtElement element); }
DocProcessor extends AbstractProcessor<CtElement> { public void process(CtElement element) { if (element instanceof CtType || element instanceof CtField || element instanceof CtExecutable) { Set<ModifierKind> modifiers = ((CtModifiable) element).getModifiers(); if (modifiers.contains(PUBLIC) || modifiers.contains(PROTECTED)) { String docComment = element.getDocComment(); if (docComment == null || docComment.equals("")) { System.out.println("undocumented element at " + element.getPosition()); undocumentedElements.add(element); } } } }  void process(CtElement element); final List<CtElement> undocumentedElements; }