@Test public void testParseMissing() throws Exception { FollowsNamedTypeBlockParser parser = new FollowsNamedTypeBlockParser("throws"); IrDocBlock block = parser.parse("throws", string(" /IllegalArgumentException")); assertEquals("@throws", block.getTag()); List<? extends IrDocFragment> fragments = block.getFragments(); assertKinds(fragments, TEXT); assertTextEquals(" /IllegalArgumentException", fragments.get(0)); }
@Override public IrDocBlock parse(String tag, JavadocScanner scanner) throws JavadocParseException { ArrayList<IrDocFragment> fragments = new ArrayList<>(); IrDocNamedType namedType = fetchNamedType(scanner); if (namedType != null) { fragments.add(namedType); } fragments.addAll(fetchRestFragments(scanner)); fragments.trimToSize(); return newBlock(tag, fragments); }
FollowsNamedTypeBlockParser extends AcceptableJavadocBlockParser { @Override public IrDocBlock parse(String tag, JavadocScanner scanner) throws JavadocParseException { ArrayList<IrDocFragment> fragments = new ArrayList<>(); IrDocNamedType namedType = fetchNamedType(scanner); if (namedType != null) { fragments.add(namedType); } fragments.addAll(fetchRestFragments(scanner)); fragments.trimToSize(); return newBlock(tag, fragments); } }
FollowsNamedTypeBlockParser extends AcceptableJavadocBlockParser { @Override public IrDocBlock parse(String tag, JavadocScanner scanner) throws JavadocParseException { ArrayList<IrDocFragment> fragments = new ArrayList<>(); IrDocNamedType namedType = fetchNamedType(scanner); if (namedType != null) { fragments.add(namedType); } fragments.addAll(fetchRestFragments(scanner)); fragments.trimToSize(); return newBlock(tag, fragments); } FollowsNamedTypeBlockParser(String...tagNames); }
FollowsNamedTypeBlockParser extends AcceptableJavadocBlockParser { @Override public IrDocBlock parse(String tag, JavadocScanner scanner) throws JavadocParseException { ArrayList<IrDocFragment> fragments = new ArrayList<>(); IrDocNamedType namedType = fetchNamedType(scanner); if (namedType != null) { fragments.add(namedType); } fragments.addAll(fetchRestFragments(scanner)); fragments.trimToSize(); return newBlock(tag, fragments); } FollowsNamedTypeBlockParser(String...tagNames); @Override IrDocBlock parse(String tag, JavadocScanner scanner); }
FollowsNamedTypeBlockParser extends AcceptableJavadocBlockParser { @Override public IrDocBlock parse(String tag, JavadocScanner scanner) throws JavadocParseException { ArrayList<IrDocFragment> fragments = new ArrayList<>(); IrDocNamedType namedType = fetchNamedType(scanner); if (namedType != null) { fragments.add(namedType); } fragments.addAll(fetchRestFragments(scanner)); fragments.trimToSize(); return newBlock(tag, fragments); } FollowsNamedTypeBlockParser(String...tagNames); @Override IrDocBlock parse(String tag, JavadocScanner scanner);  }