本文整理匯總了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 />");
}
示例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() + "/";
}
}
示例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;
}
}
}
示例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();
}
示例5: getFieldDocRef
import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
@Override
public DocReferenceable getFieldDocRef(FieldDoc fieldDoc) {
return new UnknownApiRef(fieldDoc.name());
}
示例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();
}
示例7: getAnchorName
import com.sun.javadoc.FieldDoc; //導入方法依賴的package包/類
public String getAnchorName(FieldDoc doc)
{
return doc.name();
}
示例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;
}