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


Java FieldDoc.name方法代碼示例

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


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

示例1: writeFieldDetails

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
private void writeFieldDetails(PrintWriter writer, ClassDoc clazz,
        FieldDoc field) {
    if (skipField(clazz, field)) {
        return;
    }
    String text = field.commentText();
    if (text.startsWith("INTERNAL")) {
        return;
    }
    String name = field.name();
    String constant = field.constantValueExpression();
    String link = getFieldLink(text, constant, clazz, name);
    writer.println("<h4 id=\"" + link + "\"><span class=\"methodName\">" +
            name);
    if (constant == null) {
        writer.println();
    } else {
        writer.println(" = " + constant);
    }
    writer.println("</span></h4>");
    writer.println("<div class=\"item\">" + formatText(text) + "</div>");
    writer.println("<hr />");
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:24,代碼來源:Doclet.java

示例2: parseIdentifier

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
private String parseIdentifier(Doc doc) {
  if (doc instanceof ClassDoc) {
    ClassDoc classDoc = (ClassDoc) doc;

    return parseIdentifier((Doc) classDoc.containingPackage()) + classDoc.name() + "/";
  } else if (doc instanceof AnnotationTypeElementDoc) {
    AnnotationTypeElementDoc annotationTypeElementDoc = (AnnotationTypeElementDoc) doc;
    return parseIdentifier((Doc) annotationTypeElementDoc.containingClass()) + "#" + annotationTypeElementDoc.name();
  } else if (doc instanceof FieldDoc) {
    FieldDoc fieldDoc = (FieldDoc) doc;
    return parseIdentifier((Doc) fieldDoc.containingClass()) + "#" + fieldDoc.name();
  } else if (doc instanceof ConstructorDoc) {
    ConstructorDoc constructorDoc = (ConstructorDoc) doc;
    return parseIdentifier((Doc) constructorDoc.containingClass()) + "#" + constructorDoc.name() + URLEncoder.encode(constructorDoc.flatSignature());
  } else if (doc instanceof MethodDoc) {
    MethodDoc methodDoc = (MethodDoc) doc;
    return parseIdentifier((Doc) methodDoc.containingClass()) + "#" + methodDoc.name() + URLEncoder.encode(methodDoc.flatSignature());
  } else {
    return "/" + doc.name() + "/";
  }
}
 
開發者ID:riptano,項目名稱:xml-doclet,代碼行數:22,代碼來源:Parser.java

示例3: PSItemFieldDoc

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
private PSItemFieldDoc(PSItemDoc psItemDoc, FieldDoc fieldDoc, AnnotationDesc annotation) {
    this.psItemDoc = psItemDoc;
    this.reference = fieldDoc.name();
    this.name = fieldDoc.constantValue().toString();
    this.description = fieldDoc.commentText().replace('\n', ' ');

    for (AnnotationDesc.ElementValuePair elementValuePair : annotation.elementValues()) {
        if ("type".equals(elementValuePair.element().name())) {
            Object typeValue = elementValuePair.value().value();
            this.type = (Type) typeValue;
        }
    }
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:14,代碼來源:PSItemFieldDoc.java

示例4: ExternalRef

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
public ExternalRef(FieldDoc fieldDoc) {
    name = fieldDoc.name();
    qualifiedName = fieldDoc.containingClass().qualifiedName() + "#" + fieldDoc.name();
    url = ExternalRefProvider.this.url + fieldDoc.containingPackage().name().replace('.',
            '/') + "/" + fieldDoc.containingClass().name() + ".html#" + fieldDoc.name();
}
 
開發者ID:nicolaschriste,項目名稱:docdown,代碼行數:7,代碼來源:ExternalRefProvider.java

示例5: getFieldDocRef

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
@Override
public DocReferenceable getFieldDocRef(FieldDoc fieldDoc) {
    return new UnknownApiRef(fieldDoc.name());
}
 
開發者ID:nicolaschriste,項目名稱:docdown,代碼行數:5,代碼來源:UnknownRefProvider.java

示例6: ApiPageRef

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
public ApiPageRef(FieldDoc fieldDoc, ApiPage apiPage) {
    this.name = fieldDoc.containingClass().name() + "." + fieldDoc.name();
    this.qualifiedName = fieldDoc.containingClass().qualifiedName() + "." + fieldDoc.name();
    this.apiPage = apiPage;
    this.anchor = fieldDoc.name();
}
 
開發者ID:nicolaschriste,項目名稱:docdown,代碼行數:7,代碼來源:ApiPageRef.java

示例7: getAnchorName

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
public String getAnchorName(FieldDoc doc)
{
    return doc.name();
}
 
開發者ID:tcolar,項目名稱:javaontracks,代碼行數:5,代碼來源:JOTDocletNavView.java

示例8: makeMemberInfo

import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
/**
 * Convert a javadoc object of a class field into an object of my MemberInfo class.
 * If the field is a constant, its value is read and serialized into JSON format. 
 * The JSON object is attached to the returned MemberInfo.
 * @param errInfo
 * @param field
 * @param errorContext
 * @return MemberInfo object
 * @throws GeneratorException
 */
private MemberInfo makeMemberInfo(ErrorInfo errInfo, FieldDoc field, String errorContext) throws GeneratorException {
	errInfo = errInfo.copy();
	
	String name = field.name();
	if (FORBIDDEN_FIELD_AND_METHOD_NAMES.contains(name)) {
		errInfo.fieldName = name;
		errInfo.msg = "Forbidden field name";
		throw new GeneratorException(errInfo);
	}
	
	ArrayList<CommentInfo> cinfos = new ArrayList<CommentInfo>();
	addSummaryAndRemarksCommentInfo(field, cinfos);
	
	errInfo.fieldName = name;
	TypeInfo type = makeElementTypeInfo(errInfo, field.type(), errorContext + "." + name);
	
	long since = getSince(errInfo, field.tags());
	
	// Constant or Enum?
	String value = null;
	if (((field.isFinal() && field.isStatic()) || field.isEnumConstant())) {
		ClassDoc cls = field.containingClass();
		TypeInfo ctype = new TypeInfo(cls.name(), cls.qualifiedName(), "", null, field.isEnumConstant(), false, false);
		Object valueObj = classDB.fieldReader.getValue(ctype, name);
		if (valueObj != null) {
			if (field.isEnumConstant()) {
				Enum<?> en = (Enum<?>)valueObj;
				value = Integer.toString(en.ordinal());  
			}
			else {
				value = serializeObjectToJson(errInfo, valueObj);
			}
		}
		else if (type.isStringType() && type.dims.length() == 0) {
			value = "";
		}
	}
	
	MemberInfo minfo = new MemberInfo(name, cinfos, type, 
			field.isPublic(), field.isProtected(), field.isPackagePrivate(), field.isPrivate(), 
			field.isFinal(), field.isStatic(), field.isTransient(),
			since, value);
	
	return minfo;
}
 
開發者ID:wolfgangimig,項目名稱:byps,代碼行數:56,代碼來源:BConvert.java


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