Java Code Examples for io.vertx.codegen.MethodInfo#getDoc()

The following examples show how to use io.vertx.codegen.MethodInfo#getDoc() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DocTest.java    From vertx-codegen with Apache License 2.0 5 votes vote down vote up
@Test
public void testLinkToMethodInSameType() throws Exception {
  ClassModel model = new GeneratorHelper().generateClass(LinkToMethodInSameType.class);
  MethodInfo method = model.getMethodMap().get("m").get(0);
  Doc doc = method.getDoc();
  List<Token> tokens = doc.getTokens();
  assertEquals(4, tokens.size());
  for (Token token : tokens) {
    Tag.Link link = (Tag.Link) ((Token.InlineTag) token).getTag();
    assertEquals(ElementKind.METHOD, link.getTargetElement().getKind());
    assertEquals("method(java.lang.String,int)", link.getTargetElement().toString());
  }
}
 
Example 2
Source File: DocTest.java    From vertx-codegen with Apache License 2.0 5 votes vote down vote up
@Test
public void testLinkToSameType() throws Exception {
  ClassModel model = new GeneratorHelper().generateClass(LinkToSameType.class);
  MethodInfo method = model.getMethodMap().get("m").get(0);
  Doc doc = method.getDoc();
  List<Token> tokens = doc.getTokens();
  assertEquals(2, tokens.size());
  for (Token token : tokens) {
    Tag.Link link = (Tag.Link) ((Token.InlineTag) token).getTag();
    assertEquals(LinkToSameType.class.getName(), link.getTargetElement().toString());
  }
}
 
Example 3
Source File: DocTest.java    From vertx-codegen with Apache License 2.0 5 votes vote down vote up
@Test
public void testLinkToEnum() throws Exception {
  ClassModel model = new GeneratorHelper().generateClass(LinkToEnum.class);
  MethodInfo method = model.getMethodMap().get("m").get(0);
  Doc doc = method.getDoc();
  List<Token> tokens = doc.getTokens();
  assertEquals(2, tokens.size());
  for (Token token : tokens) {
    Tag.Link link = (Tag.Link) ((Token.InlineTag) token).getTag();
    assertEquals(FooEnum.class.getName(), link.getTargetElement().toString());
  }
}
 
Example 4
Source File: DocTest.java    From vertx-codegen with Apache License 2.0 5 votes vote down vote up
@Test
public void testLinkLabel() throws Exception {
  ClassModel model = new GeneratorHelper().generateClass(LinkLabel.class);
  MethodInfo method = model.getMethodMap().get("m").get(0);
  Doc doc = method.getDoc();
  List<Token> tokens = doc.getTokens();
  String[] expectedLabels = {"","   "," the label value"};
  assertEquals(expectedLabels.length, tokens.size());
  for (int i = 0;i < tokens.size();i++) {
    Tag.Link link = (Tag.Link) ((Token.InlineTag) tokens.get(i)).getTag();
    assertEquals("" + i,expectedLabels[i], link.getLabel());
  }
}