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


Java Tag.text方法代碼示例

本文整理匯總了Java中com.sun.javadoc.Tag.text方法的典型用法代碼示例。如果您正苦於以下問題:Java Tag.text方法的具體用法?Java Tag.text怎麽用?Java Tag.text使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sun.javadoc.Tag的用法示例。


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

示例1: toComment

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
/**
 * Transforms comments on the Doc object into XML.
 *
 * @param doc The Doc object.
 * @param node The node to add the comment nodes to.
 */
private static String toComment(Tag tag) {
  if (tag.text() == null || tag.text().length() == 0) return null;
  StringBuilder comment = new StringBuilder();

  // Analyse each token and produce comment node
  for (Tag t : tag.inlineTags()) {
    Taglet taglet = options.getTagletForName(t.name());
    if (taglet != null) {
      comment.append(taglet.toString(t));
    } else {
      comment.append(t.text());
    }
  }

  return comment.toString();
}
 
開發者ID:pageseeder,項目名稱:xmldoclet,代碼行數:23,代碼來源:XMLDoclet.java

示例2: PSOperatorDoc

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
private PSOperatorDoc(ClassDoc classDoc, MethodDoc methodDoc) {
        this.declaringClassDoc = classDoc;
        this.methodDoc = methodDoc;
        this.description = methodDoc.commentText().replace('\n', ' ');
        this.paramDesc = "";

        Tag[] paramTags = methodDoc.tags("param");
        for (Tag paramTag : paramTags) {
            String paraStr = paramTag.text();
            String paraName = paraStr.substring(0, paraStr.indexOf(' ')).replace('\n', ' ');;
            String paraDesc = paraStr.substring(paraStr.indexOf(' ') + 1).replace('\n', ' ');;
            this.paramDesc += "<br> - `" + paraName + "`: " + paraDesc;
        }

        this.returnType = methodDoc.returnType();
//        ParameterizedType returnType = methodDoc.returnType().asParameterizedType();
//        this.inputType = returnType.typeArguments()[0];
//        this.outputType = returnType.typeArguments()[1];
//        this.completeSignature = "Function<" + this.inputType + ", " + this.outputType + "> " + methodDoc.toString();

        String shortSignature = classDoc.name() + "." + methodDoc.name() + "(";
        boolean firstParameter = true;
        for (Parameter parameter : methodDoc.parameters()) {
            if (firstParameter) {
                shortSignature += Utils.getSimpleTypeName(parameter.type()) + " " + parameter.name();
                firstParameter = false;
            } else {
                shortSignature += ", " + Utils.getSimpleTypeName(parameter.type()) + " " + parameter.name();
            }
        }
        shortSignature += ")";
        this.shortSignature = shortSignature;
    }
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:34,代碼來源:PSOperatorDoc.java

示例3: getFirstSentence

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
private static String getFirstSentence(Tag[] tags) {
    String firstSentence = null;
    if (tags.length > 0) {
        Tag first = tags[0];
        firstSentence = first.text();
    }
    return firstSentence;
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:9,代碼來源:Doclet.java

示例4: getText

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
public static String getText(Tag[] tags) {
    String text = "";
    for (Tag tag : tags) {
        text += tag.text();
    }
    return text;
}
 
開發者ID:JavaEden,項目名稱:Orchid,代碼行數:8,代碼來源:OrchidJavadoc.java

示例5: writeContents

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
private static void writeContents(ClassDoc[] classes, String tagName , String outputFolder)
{
	Map<String,List<String>> keywordsToAlgorithmsMap = new HashMap<String,List<String>> ();
	Map<String,List<String>> algorithmToKeywordsMap = new HashMap<String,List<String>> ();
	Map<String,String> algorithmToFirstSentence = new HashMap<String,String> ();
	
	for (int i = 0; i < classes.length; i++)
	{
		final ClassDoc javaClass = classes [i];
		final String className = javaClass.qualifiedName();
		final Tag [] firstSentenceTags = javaClass.firstSentenceTags();
		if (firstSentenceTags.length == 0) System.out.println("A class without first sentence!!: " + className);
		final String firstSentenceThisClass = (firstSentenceTags.length == 0)? "" : javaClass.firstSentenceTags() [0].text ();
		algorithmToFirstSentence.put (className , firstSentenceThisClass);
		algorithmToKeywordsMap.put (className , new LinkedList<String> ());
		String keywordsString = ""; for (Tag tag : javaClass.tags()) {  if (tag.name().equals ("@"+tagName)) keywordsString += " " + tag.text () + " "; }
		keywordsString = keywordsString.trim ();
		for (String keyword : StringUtils.split(keywordsString , ","))
		{
			final String keywordName = keyword.trim ();
			if (!keywordDescriptionMap.containsKey(keywordName)) throw new RuntimeException ("Bad: Keyword: " + keywordName + " in algorithm " + className + ", does not exist in the description");
			if (!keywordsToAlgorithmsMap.containsKey(keywordName)) keywordsToAlgorithmsMap.put (keywordName , new LinkedList<String> ());
			keywordsToAlgorithmsMap.get(keywordName).add (className);
			algorithmToKeywordsMap.get (className).add (keywordName);
		}
	}
	
	String htmlFile = createHtml(keywordsToAlgorithmsMap , algorithmToKeywordsMap , algorithmToFirstSentence , outputFolder);
	try 
	{
		File f = new File (outputFolder + "/keywords-all.html");
		System.out.println ("Save in : " + f.getAbsolutePath());
		PrintWriter pw = new PrintWriter (f);
		pw.append(htmlFile);
		pw.close ();
	} catch (Exception e) { e.printStackTrace(); throw new RuntimeException ("Not possible to write in keywords-all.html"); } 
	
}
 
開發者ID:girtel,項目名稱:Net2Plan,代碼行數:39,代碼來源:CreateHTMLKeywords.java

示例6: split

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
private String[] split(Tag tag) {
	String[] splitted = tag.text().split("\\|");
	if (splitted.length != 2) {
		System.err.println("Usage: {@" + getName() + " latexref|html_human_readable_ref} (" + tag.position() + ")");
		return new String[] { tag.text(), tag.text() };
	} else {
		return splitted;
	}
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:10,代碼來源:RefTaglet.java

示例7: getTagText

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
public static String getTagText(final Tag[] tags, final String name) {
	for (final Tag tag : tags) {
		if (tag.name().equals(name)) {
			return tag.text();
		}
	}
	return null;
}
 
開發者ID:azuki-framework,項目名稱:azuki-doclet-jaxrs,代碼行數:9,代碼來源:DocletUtility.java

示例8: computeSpecVersion

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
static SpecificationVersion computeSpecVersion(CompilationInfo info, Element el) {
    if (!Utilities.isJavadocSupported(info)) return null;

    Doc javaDoc = info.getElementUtilities().javaDocFor(el);

    if (javaDoc == null) return null;

    for (Tag since : javaDoc.tags("@since")) {
        String text = since.text();

        Matcher m = SPEC_VERSION.matcher(text);

        if (!m.find()) {
            continue;
        }

        return new SpecificationVersion(m.group()/*ver.toString()*/);
    }

    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:JavaFixUtilities.java

示例9: converter

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
@Override
public DocTag converter(Tag o) {
    return new DocTagImpl(o.name(), o.text());
}
 
開發者ID:treeleafj,項目名稱:xDoc,代碼行數:5,代碼來源:DefaultSunTagConverterImpl.java

示例10: processTag

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
@Override
public JSONElement processTag(Tag tag) {
    return new JSONElement(tag.text());
}
 
開發者ID:JavaEden,項目名稱:Orchid,代碼行數:5,代碼來源:LinkTag.java

示例11: writeContents

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
private static void writeContents(ClassDoc[] classes, String tagName , String outputFolder)
{
	for (int i = 0; i < classes.length; i++)
	{
		final ClassDoc javaClass = classes [i];
		final String className = javaClass.qualifiedName();
		final Tag [] firstSentenceTags = javaClass.firstSentenceTags();
		if (firstSentenceTags.length == 0) System.out.println("Create book sections: a class without first sentence class: " + className);
		final String firstSentenceThisClass = (firstSentenceTags.length == 0)? "" : javaClass.firstSentenceTags() [0].text ();
		algorithmToFirstSentence.put (className , firstSentenceThisClass);
		algorithmToSectionsMap.put (className , new LinkedList<String> ());
		algorithmToExercisesMap.put (className , new LinkedList<String> ());
		String keywordsString = ""; for (Tag tag : javaClass.tags()) {  if (tag.name().equals ("@"+tagName)) keywordsString += " " + tag.text () + " "; }
		keywordsString = keywordsString.trim ();
		for (String keyword : StringUtils.split(keywordsString , ","))
		{
			final String keywordName = keyword.trim ();
			if (keywordName.startsWith("Section "))
			{
				final String sectionNumber = keywordName.substring ("Section ".length()).trim ();
				if (!sectionsToAlgorithmsMap.containsKey(sectionNumber)) sectionsToAlgorithmsMap.put (sectionNumber , new LinkedList<String> ());
				sectionsToAlgorithmsMap.get(sectionNumber).add (className);
				algorithmToSectionsMap.get (className).add (sectionNumber);
			}
			else if (keywordName.startsWith("Exercise "))
			{
				final String exerciseNumber = keywordName.substring ("Exercise ".length()).trim ();
				if (!exercisesToAlgorithmsMap.containsKey(exerciseNumber)) exercisesToAlgorithmsMap.put (exerciseNumber , new LinkedList<String> ());
				exercisesToAlgorithmsMap.get(exerciseNumber).add (className);
				algorithmToExercisesMap.get (className).add (exerciseNumber);
			}
			else throw new RuntimeException ("In the tag net2plan.ocnbooksections: wrong tag value: " + keyword  + ", in class: " + className + ", keywordsString: " + keywordsString);
		}
	}
	System.out.println ("sectionsToAlgorithmsMap: " + sectionsToAlgorithmsMap);
	System.out.println ("exercisesToAlgorithmsMap: " + exercisesToAlgorithmsMap);
	System.out.println ("algorithmToSectionsMap: " + algorithmToSectionsMap);
	System.out.println ("sections: " + sectionsToAlgorithmsMap.keySet());
	System.out.println ("exercises: " + exercisesToAlgorithmsMap.keySet());
	
	String htmlFile = createHtml(outputFolder);
	try 
	{
		File f = new File (outputFolder + "/ocnbookSections.html");
		System.out.println ("Save in : " + f.getAbsolutePath());
		PrintWriter pw = new PrintWriter (f);
		pw.append(htmlFile);
		pw.close ();
	} catch (Exception e) { e.printStackTrace(); throw new RuntimeException ("Not possible to write in ocnbookSections.html"); } 
	
}
 
開發者ID:girtel,項目名稱:Net2Plan,代碼行數:52,代碼來源:CreateBookSectionsTable.java

示例12: toString

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
public String toString(Tag tag) {
   return "<code>" + tag.text() + "</code>";
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:4,代碼來源:CodeTaglet.java

示例13: printTag

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
private void printTag(Tag tag)
{
   if (null != tag.text()) {
      System.out.println(tag.text());
   }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:7,代碼來源:DebugDoclet.java

示例14: toString

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
public String toString(Tag tag) {
	return "<i>" + tag.text() + "</i>";
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:4,代碼來源:MathTaglet.java

示例15: toTex

import com.sun.javadoc.Tag; //導入方法依賴的package包/類
public String toTex(Tag tag) {
	return "$" + tag.text() + "$";
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:4,代碼來源:MathTaglet.java


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