@Test public void testNewBlock() { MockJavadocBlockParser parser = new MockJavadocBlockParser(); { IrDocBlock block = parser.newBlock(null, Collections.emptyList()); assertNull(block.getTag()); assertEquals(0, block.getFragments().size()); } { IrDocText f0 = new IrDocText("Hello, world!"); IrDocBlock block = parser.newBlock("code", Arrays.asList(f0)); assertEquals("@code", block.getTag()); assertEquals(1, block.getFragments().size()); assertEquals(f0, block.getFragments().get(0)); } { IrDocSimpleName f0 = new IrDocSimpleName("arg0"); IrDocText f1 = new IrDocText("Hello!"); IrDocText f2 = new IrDocText("This is text"); IrDocBlock block = parser.newBlock("param", Arrays.asList(f0, f1, f2)); assertEquals("@param", block.getTag()); assertEquals(3, block.getFragments().size()); assertEquals(f0, block.getFragments().get(0)); assertEquals(f1, block.getFragments().get(1)); assertEquals(f2, block.getFragments().get(2)); } }
public IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments) { if (fragments == null) { throw new IllegalArgumentException("fragments"); } IrDocBlock block = new IrDocBlock(); block.setTag(tag); block.setFragments(fragments); return block; }
JavadocBlockParser extends JavadocBaseParser { public IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments) { if (fragments == null) { throw new IllegalArgumentException("fragments"); } IrDocBlock block = new IrDocBlock(); block.setTag(tag); block.setFragments(fragments); return block; } }
JavadocBlockParser extends JavadocBaseParser { public IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments) { if (fragments == null) { throw new IllegalArgumentException("fragments"); } IrDocBlock block = new IrDocBlock(); block.setTag(tag); block.setFragments(fragments); return block; } protected  JavadocBlockParser(); protected  JavadocBlockParser(List<? extends JavadocBlockParser> blockParsers); }
JavadocBlockParser extends JavadocBaseParser { public IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments) { if (fragments == null) { throw new IllegalArgumentException("fragments"); } IrDocBlock block = new IrDocBlock(); block.setTag(tag); block.setFragments(fragments); return block; } protected  JavadocBlockParser(); protected  JavadocBlockParser(List<? extends JavadocBlockParser> blockParsers); abstract boolean canAccept(String tag); abstract IrDocBlock parse(String tag, JavadocScanner scanner); IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments); List<IrDocFragment> fetchRestFragments(JavadocScanner scanner); IrDocSimpleName fetchSimpleName(JavadocScanner scanner); IrDocName fetchName(JavadocScanner scanner); IrDocBasicType fetchBasicType(JavadocScanner scanner); IrDocBasicType fetchPrimitiveType(JavadocScanner scanner); IrDocNamedType fetchNamedType(JavadocScanner scanner); IrDocType fetchType(JavadocScanner scanner); IrDocField fetchField(JavadocScanner scanner); IrDocMethod fetchMethod(JavadocScanner scanner); IrDocFragment fetchLinkTarget(JavadocScanner scanner); }
JavadocBlockParser extends JavadocBaseParser { public IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments) { if (fragments == null) { throw new IllegalArgumentException("fragments"); } IrDocBlock block = new IrDocBlock(); block.setTag(tag); block.setFragments(fragments); return block; } protected  JavadocBlockParser(); protected  JavadocBlockParser(List<? extends JavadocBlockParser> blockParsers); abstract boolean canAccept(String tag); abstract IrDocBlock parse(String tag, JavadocScanner scanner); IrDocBlock newBlock(String tag, List<? extends IrDocFragment> fragments); List<IrDocFragment> fetchRestFragments(JavadocScanner scanner); IrDocSimpleName fetchSimpleName(JavadocScanner scanner); IrDocName fetchName(JavadocScanner scanner); IrDocBasicType fetchBasicType(JavadocScanner scanner); IrDocBasicType fetchPrimitiveType(JavadocScanner scanner); IrDocNamedType fetchNamedType(JavadocScanner scanner); IrDocType fetchType(JavadocScanner scanner); IrDocField fetchField(JavadocScanner scanner); IrDocMethod fetchMethod(JavadocScanner scanner); IrDocFragment fetchLinkTarget(JavadocScanner scanner);  }