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


Java SerialFieldTree类代码示例

本文整理汇总了Java中com.sun.source.doctree.SerialFieldTree的典型用法代码示例。如果您正苦于以下问题:Java SerialFieldTree类的具体用法?Java SerialFieldTree怎么用?Java SerialFieldTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SerialFieldTree类属于com.sun.source.doctree包,在下文中一共展示了SerialFieldTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: visitSerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public Void visitSerialField(SerialFieldTree node, Void p) {
    printTagName(node);
    print(" ");
    print((DCTree)node.getName());
    print(" ");
    print((DCTree)node.getType());
    if (!node.getDescription().isEmpty()) {
        print(" ");
        for (DocTree docTree : node.getDescription()) {
            doAccept((DCTree)docTree);
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VeryPretty.java

示例3: visitSerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public Void visitSerialField(SerialFieldTree node, List<ErrorDescription> errors) {
    boolean oldInheritDoc = foundInheritDoc;
    super.visitSerialField(node, errors);
    foundInheritDoc = oldInheritDoc;
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:Analyzer.java

示例4: getName

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
public IdentifierTree getName(DocTree dtree) {
    switch (dtree.getKind()) {
        case PARAM:
            return ((ParamTree)dtree).getName();
        case SERIAL_FIELD:
            return ((SerialFieldTree)dtree).getName();
        default:
            return null;
        }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:CommentHelper.java

示例5: getType

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
public ReferenceTree getType(DocTree dtree) {
    if (dtree.getKind() == SERIAL_FIELD) {
        return ((SerialFieldTree)dtree).getType();
    } else {
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:CommentHelper.java

示例6: makeSerialFieldTreeComparator

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
 * Returns a Comparator for SerialFieldTree.
 * @return a Comparator
 */
public Comparator<SerialFieldTree> makeSerialFieldTreeComparator() {
    if (serialFieldTreeComparator == null) {
        serialFieldTreeComparator = (SerialFieldTree o1, SerialFieldTree o2) -> {
            String s1 = o1.getName().toString();
            String s2 = o2.getName().toString();
            return s1.compareTo(s2);
        };
    }
    return serialFieldTreeComparator;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:Utils.java

示例7: makeSerialFieldTreeComparator

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
 * Returns a Comparator for SerialFieldTree.
 * @return a Comparator
 */
public Comparator<SerialFieldTree> makeSerialFieldTreeComparator() {
    return (SerialFieldTree o1, SerialFieldTree o2) -> {
        String s1 = o1.getName().toString();
        String s2 = o2.getName().toString();
        return s1.compareTo(s2);
    };
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:12,代码来源:Utils.java

示例8: visitSerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public DocTree visitSerialField(SerialFieldTree tree, Object p) {
    return rewriteChildren(tree);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ImmutableDocTreeTranslator.java

示例9: SerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
public SerialFieldTree SerialField(com.sun.source.doctree.IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) {
    return docMake.at(NOPOS).newSerialFieldTree(name, type, description);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:TreeFactory.java

示例10: visitSerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
 * @since 1.47
 */
@Override
public DocTree visitSerialField(SerialFieldTree node, Element p) {
    return docScanner.visitSerialField(node, p, null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RefactoringVisitor.java

示例11: visitSerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:Checker.java

示例12: visitSerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:Checker.java

示例13: 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

示例14: 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

示例15: SerialField

import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**Creates the DocTree's SerialFieldTree.
 * 
 * @param name the name of the field
 * @param type the type of the field
 * @param description the description of the field
 * @return newly created SerialFieldTree
 * @since 0.124
 */
public SerialFieldTree SerialField(com.sun.source.doctree.IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) {
    return delegate.SerialField(name, type, description);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:TreeMaker.java


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