當前位置: 首頁>>代碼示例>>Java>>正文


Java JavadocManager類代碼示例

本文整理匯總了Java中org.walkmod.javalang.JavadocManager的典型用法代碼示例。如果您正苦於以下問題:Java JavadocManager類的具體用法?Java JavadocManager怎麽用?Java JavadocManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JavadocManager類屬於org.walkmod.javalang包,在下文中一共展示了JavadocManager類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testMultipleTag

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testMultipleTag() throws Exception {
    String javadoc = "@author <a href=\"mailto:[email protected]\">walkmod</a> \n @version 1.5 ";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 2);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@author", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(1, jt.getValues().size());
    Assert.assertEquals("<a href=\"mailto:[email protected]\">walkmod</a>", jt.getValues().get(0));
    jt = tags.get(1);
    Assert.assertEquals("@version", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(1, jt.getValues().size());
    Assert.assertEquals("1.5", jt.getValues().get(0));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:17,代碼來源:JavadocTest.java

示例2: testSpecificBlockTags

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testSpecificBlockTags() throws Exception {
    String javadoc = "@param  fooParam  my param description";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@param", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(2, jt.getValues().size());
    Assert.assertEquals("fooParam", jt.getValues().get(0));
    Assert.assertEquals("my param description", jt.getValues().get(1));
    javadoc = "@param  fooParam";
    tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    jt = tags.get(0);
    Assert.assertEquals("@param", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(1, jt.getValues().size());
    Assert.assertEquals("fooParam", jt.getValues().get(0));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:21,代碼來源:JavadocTest.java

示例3: testInlineTags

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testInlineTags() throws Exception {
    String javadoc = "Use the {@link #getComponentAt(int, int) getComponentAt} method.";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@link", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(2, jt.getValues().size());
    Assert.assertEquals("#getComponentAt(int, int)", jt.getValues().get(0));
    Assert.assertEquals("getComponentAt", jt.getValues().get(1));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:13,代碼來源:JavadocTest.java

示例4: testInlineTagsWithArray

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testInlineTagsWithArray() throws Exception {
    String javadoc = "Use the {@link #getComponentAt(int[], int[]) getComponentAt} method.";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@link", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(2, jt.getValues().size());
    Assert.assertEquals("#getComponentAt(int[], int[])", jt.getValues().get(0));
    Assert.assertEquals("getComponentAt", jt.getValues().get(1));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:13,代碼來源:JavadocTest.java

示例5: testInnnerCode

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testInnnerCode() throws Exception {
    String javadoc = "{@code \n" + "public static double sqrt(double value) {\n"
            + "  Preconditions.checkArgument(value >= 0.0, \"negative value: %s\", value);\n"
            + "  // calculate the square root\n" + "}\n" + "void exampleBadCaller() {\n"
            + "  double d = sqrt(-1.0);\n" + "}};";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@code", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(1, jt.getValues().size());
    String code = jt.getValues().get(0);
    Assert.assertTrue(code.contains("double d = sqrt(-1.0);"));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:16,代碼來源:JavadocTest.java

示例6: testInnnerEmptyBraces

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testInnnerEmptyBraces() throws Exception {
    String javadoc = "{@code \n" + " static <T> TypeToken<List<T>> listOf(Class<T> elementType) {\n"
            + "     return new TypeToken<List<T>>() {}\n"
            + "         .where(new TypeParameter<T>() {}, elementType);\n" + "   }}";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@code", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(1, jt.getValues().size());
    String code = jt.getValues().get(0);
    Assert.assertTrue(code.contains("new TypeParameter<T>()"));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:15,代碼來源:JavadocTest.java

示例7: testInnnerJavadocTags

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testInnnerJavadocTags() throws Exception {
    String javadoc = "{@code \n" + "/**\n" + "* Returns the positive square root of the given value.\n" + "*\n"
            + "* @throws IllegalArgumentException if the value is negative\n" + "*}";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@code", jt.getName());
    Assert.assertNotNull(jt.getValues());
    Assert.assertEquals(1, jt.getValues().size());
    String code = jt.getValues().get(0);
    Assert.assertTrue(code.contains("@throws IllegalArgumentException"));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:14,代碼來源:JavadocTest.java

示例8: testMultipleLineJavadocTags

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testMultipleLineJavadocTags() throws Exception {
    String javadoc = "Weak reference with a method which a background thread invokes after\n";
    javadoc += "* the garbage collector reclaims the referent. This is a simpler alternative to using a {@link\n";
    javadoc += "* ReferenceQueue }.";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() == 1);
    JavadocTag jt = tags.get(0);
    Assert.assertEquals("@link", jt.getName());
    Assert.assertEquals("ReferenceQueue", jt.getValues().get(0));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:12,代碼來源:JavadocTest.java

示例9: testJavadocFailure

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testJavadocFailure() throws Exception {

    String javadoc = FileUtils.fileToString("src/test/resources/javadocFailure.txt");
    javadoc = javadoc.replaceAll("\\*", "");
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(tags.size() > 1);

}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:10,代碼來源:JavadocTest.java

示例10: testSingleTag

import org.walkmod.javalang.JavadocManager; //導入依賴的package包/類
@Test
public void testSingleTag() throws Exception {
    String javadoc = "@author walkmod";
    List<JavadocTag> tags = JavadocManager.parse(javadoc);
    Assert.assertTrue(!tags.isEmpty());
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:7,代碼來源:JavadocTest.java


注:本文中的org.walkmod.javalang.JavadocManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。