Example usage for org.eclipse.jdt.core.dom TypeDeclarationStatement getStartPosition

List of usage examples for org.eclipse.jdt.core.dom TypeDeclarationStatement getStartPosition

Introduction

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

Prototype

public final int getStartPosition() 

Source Link

Document

Returns the character index into the original source file indicating where the source fragment corresponding to this node begins.

Usage

From source file:br.uff.ic.gems.resources.ast.Visitor.java

@Override
public boolean visit(TypeDeclarationStatement node) {
    int beginLine = cu.getLineNumber(node.getStartPosition());
    int endLine = cu.getLineNumber(node.getStartPosition() + node.getLength());
    int beginColumn = cu.getColumnNumber(node.getStartPosition());
    int endColumn = cu.getColumnNumber(node.getStartPosition() + node.getLength());

    languageConstructs.add(/*www.  ja va2 s. c o  m*/
            new LanguageConstruct(node.getClass().getSimpleName(), beginLine, endLine, beginColumn, endColumn));

    return true;
}