Example usage for org.eclipse.jdt.core.dom TypeParameter getLength

List of usage examples for org.eclipse.jdt.core.dom TypeParameter getLength

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom TypeParameter getLength.

Prototype

public final int getLength() 

Source Link

Document

Returns the length in characters of the original source file indicating where the source fragment corresponding to this node ends.

Usage

From source file:com.chookapp.org.bracketeer.jdt.ClosingBracketHintVisitor.java

License:Open Source License

private void addBrackets(List<TypeParameter> typeParameters) throws BadLocationException {
    if (typeParameters == null || typeParameters.isEmpty())
        return;/*from  ww  w  . j  a  va2s .c  om*/

    TypeParameter type = typeParameters.get(0);
    int startLoc = type.getStartPosition() - 1;
    type = typeParameters.get(typeParameters.size() - 1);
    int endLoc = type.getStartPosition() + type.getLength();
    _container.add(new BracketsPair(startLoc, '<', endLoc, '>'));
}