com.sun.source.doctree.ValueTree Java Examples

The following examples show how to use com.sun.source.doctree.ValueTree. 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: TencentKona-8   Author: Tencent   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #2
Source Project: jdk8u60   Author: chenghanpeng   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #3
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #4
Source Project: netbeans   Author: apache   File: ImmutableDocTreeTranslator.java    License: Apache License 2.0 5 votes vote down vote up
protected final ValueTree rewriteChildren(ValueTree tree) {
    ValueTree value = tree;
    ReferenceTree reference = (ReferenceTree) translate(tree.getReference());
    if (reference != tree.getReference()) {
        value = make.Value(reference);
    }
    return value;
}
 
Example #5
Source Project: netbeans   Author: apache   File: VeryPretty.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree node, Void p) {
    print("{");
    printTagName(node);
    if (node.getReference() != null) {
        print(" ");
        print((DCTree)node.getReference());
    }
    print("}");
    return null;
}
 
Example #6
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #7
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #8
Source Project: hottub   Author: dsrg-uoft   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #9
Source Project: openjdk-8-source   Author: keerath   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #10
Source Project: openjdk-8   Author: bpupadhyaya   File: Checker.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitValue(ValueTree tree, Void ignore) {
    ReferenceTree ref = tree.getReference();
    if (ref == null || ref.getSignature().isEmpty()) {
        if (!isConstant(env.currElement))
            env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
    } else {
        Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
        if (!isConstant(e))
            env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
    }

    markEnclosingTag(Flag.HAS_INLINE_TAG);
    return super.visitValue(tree, ignore);
}
 
Example #11
Source Project: netbeans   Author: apache   File: ImmutableDocTreeTranslator.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public DocTree visitValue(ValueTree tree, Object p) {
    return rewriteChildren(tree);
}
 
Example #12
Source Project: netbeans   Author: apache   File: TreeFactory.java    License: Apache License 2.0 4 votes vote down vote up
public ValueTree Value(ReferenceTree ref) {
    return docMake.at(NOPOS).newValueTree(ref);
}
 
Example #13
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 visitValue(ValueTree node, Element p) {
    return docScanner.visitValue(node, p, null);
}
 
Example #14
Source Project: netbeans   Author: apache   File: RefactoringVisitor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public DocTree visitValue(ValueTree node, Element p) {
    return instance.visitValue(node, p);
}
 
Example #15
Source Project: netbeans   Author: apache   File: RefactoringVisitor.java    License: Apache License 2.0 4 votes vote down vote up
public DocTree visitValue(ValueTree node, Element p, Void ignore) {
    return super.visitValue(node, p);
}
 
Example #16
Source Project: netbeans   Author: apache   File: Analyzer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Void visitValue(ValueTree node, List<ErrorDescription> errors) {
    return super.visitValue(node, errors);
}
 
Example #17
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 ValueTree} object, to represent a {@code {@value } } tag.
 * @param ref a reference to the value
 * @return a {@code ValueTree} object
 */
ValueTree newValueTree(ReferenceTree ref);
 
Example #18
Source Project: netbeans   Author: apache   File: TreeMaker.java    License: Apache License 2.0 2 votes vote down vote up
/**Creates the DocTree's ValueTree.
 * 
 * @param ref the value's reference
 * @return newly created ValueTree
 * @since 0.124
 */
public ValueTree Value(ReferenceTree ref) {
    return delegate.Value(ref);
}
 
Example #19
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 ValueTree} object, to represent a {@code {@value } } tag.
 * @param ref a reference to the value
 * @return a {@code ValueTree} object
 */
ValueTree newValueTree(ReferenceTree ref);