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


Java JavadocTag類代碼示例

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


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

示例1: testMultipleTag

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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.ast.body.JavadocTag; //導入依賴的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: processJavadocTypeReference

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的package包/類
private void processJavadocTypeReference(String type, JavadocTag n) {
    if (type != null) {
        String[] split = type.split("#");
        String typeName = split[0];
        if (!"".equals(typeName)) {
            symbolTable.lookUpSymbolForRead(typeName, n, ReferenceType.TYPE);
        }
        if (split.length == 2) {
            String signature = split[1];
            int start = signature.indexOf("(");
            if (start > 0 && signature.endsWith(")")) {
                signature = signature.substring(start + 1, signature.length() - 1);
                String[] params = signature.split(",");
                if (params != null) {
                    for (String param : params) {
                        if (!"".equals(param)) {
                            if (param.endsWith("[]")) {
                                param = param.substring(0, param.length() - 2);
                            }
                            symbolTable.lookUpSymbolForRead(param.trim(), n, ReferenceType.TYPE);
                        }
                    }
                }
            }
        }
    }
}
 
開發者ID:rpau,項目名稱:javalang-compiler,代碼行數:28,代碼來源:SymbolVisitorAdapter.java

示例4: javadoc

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的package包/類
final public List<JavadocTag> javadoc() throws ParseException {
    List<JavadocTag> result = new LinkedList();
    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
        case PARAM:
        case RETURN:
        case THROWS:
        case EXCEPTION:
        case SEE:
        case SERIALFIELD:
        case SERIALDATA:
        case SERIAL:
        case DEPRECATED:
        case AUTHOR:
        case SINCE:
        case VERSION:
        case OPENBRACE:
        case CLOSEBRACE:
        case ASTERISK:
        case IDENTIFIER:
        case NAMECHAR:
        case OPERATION:
        case WORD:
            description(result);
            break;
        default:
            jj_la1[0] = jj_gen;;
    }
    jj_consume_token(0);
    {
        if (true)
            return result;
    }
    throw new Error("Missing return statement in function");
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:35,代碼來源:TagsParser.java

示例5: parse

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的package包/類
public static List<JavadocTag> parse(String content) throws Exception {
    List<JavadocTag> javadocTags = null;
    if (content != null) {
        InputStream is = new ByteArrayInputStream(content.getBytes());
        try {
            javadocTags = TagsParser.parse(is);
        } finally {
            is.close();
        }
    }
    return javadocTags;
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:13,代碼來源:JavadocManager.java

示例6: testInlineTags

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例7: testInlineTagsWithArray

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例8: testInnnerCode

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例9: testInnnerEmptyBraces

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例10: testInnnerJavadocTags

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例11: testMultipleLineJavadocTags

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例12: testJavadocFailure

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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

示例13: parse

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的package包/類
public static List<JavadocTag> parse(InputStream aInSt) throws ParseException {
    // create a parser (this object)
    TagsParser parser = new TagsParser(aInSt);
    // parse!
    return parser.javadoc();
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:7,代碼來源:TagsParser.java

示例14: main

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的package包/類
public List<JavadocTag> main(String[] args) throws ParseException, FileNotFoundException {
    return parse(new FileInputStream(args[0]));
}
 
開發者ID:rpau,項目名稱:javalang,代碼行數:4,代碼來源:TagsParser.java

示例15: testSingleTag

import org.walkmod.javalang.ast.body.JavadocTag; //導入依賴的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.ast.body.JavadocTag類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。