当前位置: 首页>>代码示例>>Java>>正文


Java SerialFieldTree.getName方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ImmutableDocTreeTranslator.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:47,代码来源:SerializedFormBuilder.java

示例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);
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:47,代码来源:SerializedFormBuilder.java


注:本文中的com.sun.source.doctree.SerialFieldTree.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。