本文整理汇总了Java中com.sun.source.doctree.SerialFieldTree.getName方法的典型用法代码示例。如果您正苦于以下问题:Java SerialFieldTree.getName方法的具体用法?Java SerialFieldTree.getName怎么用?Java SerialFieldTree.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.source.doctree.SerialFieldTree
的用法示例。
在下文中一共展示了SerialFieldTree.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rewriteChildren
import com.sun.source.doctree.SerialFieldTree; //导入方法依赖的package包/类
protected final SerialFieldTree rewriteChildren(SerialFieldTree tree) {
SerialFieldTree value = tree;
IdentifierTree name = (IdentifierTree) translate(tree.getName());
List<? extends DocTree> description = translateDoc(tree.getDescription());
ReferenceTree ref = (ReferenceTree) translate(tree.getType());
if (ref != tree.getType() || name != tree.getName() || description != tree.getDescription()) {
value = make.SerialField(name, ref, description);
}
return value;
}
示例2: buildSerialFieldTagsInfo
import com.sun.source.doctree.SerialFieldTree; //导入方法依赖的package包/类
/**
* Build the serial field tags information.
*
* @param serializableFieldsTree content tree to which the documentation will be added
*/
protected void buildSerialFieldTagsInfo(Content serializableFieldsTree) {
if (configuration.nocomment) {
return;
}
VariableElement field = (VariableElement)currentMember;
// Process Serializable Fields specified as array of
// ObjectStreamFields. Print a member for each serialField tag.
// (There should be one serialField tag per ObjectStreamField
// element.)
SortedSet<SerialFieldTree> tags = new TreeSet<>(utils.makeSerialFieldTreeComparator());
// sort the elements
for (DocTree dt : utils.getSerialFieldTrees(field)) {
SerialFieldTree st = (SerialFieldTree) dt;
tags.add(st);
}
CommentHelper ch = utils.getCommentHelper(field);
for (SerialFieldTree tag : tags) {
if (tag.getName() == null || tag.getType() == null) // ignore malformed @serialField tags
continue;
Content fieldsContentTree = fieldWriter.getFieldsContentHeader(tag.equals(tags.last()));
TypeElement te = ch.getReferencedClass(configuration, tag);
String fieldType = ch.getReferencedMemberName(tag);
if (te != null && utils.isPrimitive(te.asType())) {
fieldType = utils.getTypeName(te.asType(), false);
te = null;
}
String refSignature = ch.getReferencedSignature(tag);
// TODO: Print the signature directly, if it is an array, the
// current DocTree APIs makes it very hard to distinguish
// an as these are returned back as "Array" a DeclaredType.
if (refSignature.endsWith("[]")) {
te = null;
fieldType = refSignature;
}
fieldWriter.addMemberHeader(te, fieldType, "",
tag.getName().getName().toString(), fieldsContentTree);
fieldWriter.addMemberDescription(field, tag, fieldsContentTree);
serializableFieldsTree.addContent(fieldsContentTree);
}
}
示例3: buildSerialFieldTagsInfo
import com.sun.source.doctree.SerialFieldTree; //导入方法依赖的package包/类
/**
* Build the serial field tags information.
*
* @param serializableFieldsTree content tree to which the documentation will be added
*/
public void buildSerialFieldTagsInfo(Content serializableFieldsTree) {
if(configuration.nocomment){
return;
}
VariableElement field = (VariableElement)currentMember;
// Process Serializable Fields specified as array of
// ObjectStreamFields. Print a member for each serialField tag.
// (There should be one serialField tag per ObjectStreamField
// element.)
SortedSet<SerialFieldTree> tags = new TreeSet<>(utils.makeSerialFieldTreeComparator());
// sort the elements
for (DocTree dt : utils.getSerialFieldTrees(field)) {
SerialFieldTree st = (SerialFieldTree) dt;
tags.add(st);
}
CommentHelper ch = utils.getCommentHelper(field);
for (SerialFieldTree tag : tags) {
if (tag.getName() == null || tag.getType() == null) // ignore malformed @serialField tags
continue;
Content fieldsContentTree = fieldWriter.getFieldsContentHeader(tag.equals(tags.last()));
TypeElement te = ch.getReferencedClass(configuration, tag);
String fieldType = ch.getReferencedMemberName(tag);
if (te != null && utils.isPrimitive(te.asType())) {
fieldType = utils.getTypeName(te.asType(), false);
te = null;
}
String refSignature = ch.getReferencedSignature(tag);
// TODO: Print the signature directly, if it is an array, the
// current DocTree APIs makes it very hard to distinguish
// an as these are returned back as "Array" a DeclaredType.
if (refSignature.endsWith("[]")) {
te = null;
fieldType = refSignature;
}
fieldWriter.addMemberHeader(te, fieldType, "",
tag.getName().getName().toString(), fieldsContentTree);
fieldWriter.addMemberDescription(field, tag, fieldsContentTree);
serializableFieldsTree.addContent(fieldsContentTree);
}
}