com.sun.source.doctree.SerialFieldTree Java Examples

The following examples show how to use com.sun.source.doctree.SerialFieldTree. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: netbeans   Author: apache   File: ImmutableDocTreeTranslator.java    License: Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #2
Source Project: netbeans   Author: apache   File: VeryPretty.java    License: Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #3
Source Project: netbeans   Author: apache   File: Analyzer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree node, List<ErrorDescription> errors) {
    boolean oldInheritDoc = foundInheritDoc;
    super.visitSerialField(node, errors);
    foundInheritDoc = oldInheritDoc;
    return null;
}
 
Example #4
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CommentHelper.java    License: GNU General Public License v2.0 5 votes vote down vote up
public IdentifierTree getName(DocTree dtree) {
    switch (dtree.getKind()) {
        case PARAM:
            return ((ParamTree)dtree).getName();
        case SERIAL_FIELD:
            return ((SerialFieldTree)dtree).getName();
        default:
            return null;
        }
}
 
Example #5
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CommentHelper.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ReferenceTree getType(DocTree dtree) {
    if (dtree.getKind() == SERIAL_FIELD) {
        return ((SerialFieldTree)dtree).getType();
    } else {
        return null;
    }
}
 
Example #6
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Utils.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    };
}
 
Example #7
Source Project: TencentKona-8   Author: Tencent   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #8
Source Project: jdk8u60   Author: chenghanpeng   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #9
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #10
Source Project: netbeans   Author: apache   File: ImmutableDocTreeTranslator.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public DocTree visitSerialField(SerialFieldTree tree, Object p) {
    return rewriteChildren(tree);
}
 
Example #11
Source Project: netbeans   Author: apache   File: TreeFactory.java    License: Apache License 2.0 4 votes vote down vote up
public SerialFieldTree SerialField(com.sun.source.doctree.IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) {
    return docMake.at(NOPOS).newSerialFieldTree(name, type, description);
}
 
Example #12
Source Project: netbeans   Author: apache   File: RefactoringVisitor.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * @since 1.47
 */
@Override
public DocTree visitSerialField(SerialFieldTree node, Element p) {
    return docScanner.visitSerialField(node, p, null);
}
 
Example #13
Source Project: netbeans   Author: apache   File: RefactoringVisitor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public DocTree visitSerialField(SerialFieldTree node, Element p) {
    return instance.visitSerialField(node, p);
}
 
Example #14
Source Project: netbeans   Author: apache   File: RefactoringVisitor.java    License: Apache License 2.0 4 votes vote down vote up
public DocTree visitSerialField(SerialFieldTree node, Element p, Void ignore) {
    return super.visitSerialField(node, p);
}
 
Example #15
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #16
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #17
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: SerializedFormBuilder.java    License: GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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);
    }
}
 
Example #18
Source Project: hottub   Author: dsrg-uoft   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #19
Source Project: openjdk-8-source   Author: keerath   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #20
Source Project: openjdk-8   Author: bpupadhyaya   File: Checker.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
    warnIfEmpty(tree, tree.getDescription());
    return super.visitSerialField(tree, ignore);
}
 
Example #21
Source Project: lua-for-android   Author: qtiuto   File: DocTreeFactory.java    License: BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Create a new {@code SerialFieldTree} object, to represent a {@code @serialField } tag.
 * @param name the name of the field
 * @param type the type of the field
 * @param description the description of the field
 * @return a {@code SerialFieldTree} object
 */
SerialFieldTree newSerialFieldTree(IdentifierTree name, ReferenceTree type, List<? extends DocTree> description);
 
Example #22
Source Project: netbeans   Author: apache   File: TreeMaker.java    License: Apache License 2.0 2 votes vote down vote up
/**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);
}
 
Example #23
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: DocTreeFactory.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@code SerialFieldTree} object, to represent a {@code @serialField } tag.
 * @param name the name of the field
 * @param type the type of the field
 * @param description the description of the field
 * @return a {@code SerialFieldTree} object
 */
SerialFieldTree newSerialFieldTree(IdentifierTree name, ReferenceTree type, List<? extends DocTree> description);