Java Code Examples for com.sun.source.util.DocTreePath#getParentPath()

The following examples show how to use com.sun.source.util.DocTreePath#getParentPath() . 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 File: JavadocCompletionQuery.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void insideTag(DocTreePath tag, JavadocContext jdctx) {
    switch (tag.getLeaf().getKind()) {
        case IDENTIFIER:
            if (tag.getParentPath() == null || tag.getParentPath().getLeaf().getKind() != Kind.PARAM)
                break;
            tag = tag.getParentPath();
            //intentional fall-through:
        case PARAM:
            insideParamTag(tag, jdctx);
            break;
        case SEE: case THROWS: case VALUE:
        case LINK: case LINK_PLAIN://XXX: was only unclosed???
            insideSeeTag(tag, jdctx);
            break;
        case REFERENCE:
            insideReference(tag, jdctx);
            break;
    }
}
 
Example 2
Source File: DocTreePathHandle.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private DocTreePath resolvePathForPos(CompilationInfo javac, TreePath treePath, DocCommentTree doc, int pos) {
    DocTreePath tp = javac.getTreeUtilities().pathFor(treePath, doc, pos);
    while (tp != null) {
        KindPath kindPath1 = new KindPath(tp);
        kindPath.getList().remove(Tree.Kind.ERRONEOUS);
        if (kindPath1.equals(kindPath)) {
            return tp;
        }
        tp = tp.getParentPath();
    }
    return null;
}
 
Example 3
Source File: DocTreePathHandle.java    From netbeans with Apache License 2.0 4 votes vote down vote up
KindPath(DocTreePath treePath) {
    while (treePath != null) {
        kindPath.add(treePath.getLeaf().getKind());
        treePath = treePath.getParentPath();
    }
}