Example usage for org.eclipse.jdt.internal.core JavadocConstants ANCHOR_SUFFIX_LENGTH

List of usage examples for org.eclipse.jdt.internal.core JavadocConstants ANCHOR_SUFFIX_LENGTH

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core JavadocConstants ANCHOR_SUFFIX_LENGTH.

Prototype

int ANCHOR_SUFFIX_LENGTH

To view the source code for org.eclipse.jdt.internal.core JavadocConstants ANCHOR_SUFFIX_LENGTH.

Click Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.JavadocContents.java

License:Open Source License

private int[] computeChildRange(int anchorEndStart, char[] anchor, int indexOfBottom) {
    int[] range = null;

    // try to find the bottom of the section
    if (indexOfBottom != -1) {
        // try to find the end of the anchor
        int indexOfEndLink = CharOperation.indexOf(JavadocConstants.ANCHOR_SUFFIX, this.content, false,
                anchorEndStart + anchor.length);
        if (indexOfEndLink != -1) {
            // try to find the next anchor
            int indexOfNextElement = CharOperation.indexOf(JavadocConstants.ANCHOR_PREFIX_START, this.content,
                    false, indexOfEndLink);

            int javadocStart = indexOfEndLink + JavadocConstants.ANCHOR_SUFFIX_LENGTH;
            int javadocEnd = indexOfNextElement == -1 ? indexOfBottom
                    : Math.min(indexOfNextElement, indexOfBottom);
            range = new int[] { javadocStart, javadocEnd };
        } else {//from  w  w  w .  ja v a2s .com
            // the anchor has no suffix
            range = UNKNOWN_FORMAT;
        }
    } else {
        // the detail section has no bottom
        range = UNKNOWN_FORMAT;
    }

    return range;
}