Search in sources :

Example 11 with DocletParser

use of org.eclipse.n4js.jsdoc.DocletParser in project n4js by eclipse.

the class LineTagTest method testLineTagWithRegion.

@SuppressWarnings("javadoc")
@Test
public void testLineTagWithRegion() {
    String in = "/** foo.\n * @stubLineTagTitle {@region value} \n */";
    AbstractLineTagDefinition tag = new StubLineTagWithRegionDefinition("stubLineTagTitle");
    DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tag)), new TagDictionary<AbstractInlineTagDefinition>());
    Doclet doclet = docletParser.parse(in);
    LineTag lineTag = doclet.getLineTags().get(0);
    TagValue region = lineTag.getValueByKey(StubLineTagWithRegionDefinition.REGION);
    Text strcturedText = (Text) region.getContents().get(0);
    assertEquals("@region value", strcturedText.getText());
}
Also used : LineTag(org.eclipse.n4js.jsdoc.dom.LineTag) Doclet(org.eclipse.n4js.jsdoc.dom.Doclet) DocletParser(org.eclipse.n4js.jsdoc.DocletParser) Text(org.eclipse.n4js.jsdoc.dom.Text) TagValue(org.eclipse.n4js.jsdoc.dom.TagValue) Test(org.junit.Test)

Aggregations

DocletParser (org.eclipse.n4js.jsdoc.DocletParser)11 Doclet (org.eclipse.n4js.jsdoc.dom.Doclet)11 Test (org.junit.Test)9 LineTag (org.eclipse.n4js.jsdoc.dom.LineTag)6 Text (org.eclipse.n4js.jsdoc.dom.Text)6 N4JSDocletParser (org.eclipse.n4js.jsdoc.N4JSDocletParser)4 TagValue (org.eclipse.n4js.jsdoc.dom.TagValue)4 ContentNode (org.eclipse.n4js.jsdoc.dom.ContentNode)3 FullMemberReference (org.eclipse.n4js.jsdoc.dom.FullMemberReference)2 Composite (org.eclipse.n4js.jsdoc.dom.Composite)1 InlineTag (org.eclipse.n4js.jsdoc.dom.InlineTag)1