Example usage for org.aspectj.weaver IHasPosition getStart

List of usage examples for org.aspectj.weaver IHasPosition getStart

Introduction

In this page you can find the example usage for org.aspectj.weaver IHasPosition getStart.

Prototype

int getStart();

Source Link

Document

The starting index of this location in the character stream.

Usage

From source file:org.caesarj.compiler.aspectj.CaesarScope.java

License:Open Source License

/**
 * Creates the ISourceLocation for the given location.
 *///w w  w.j a  v a2 s.  c  om
protected ISourceLocation makeSourceLocation(IHasPosition location) {

    if (location instanceof IHasSourceLocation) {
        IHasSourceLocation pattern = (IHasSourceLocation) location;
        ISourceContext sourceContext = pattern.getSourceContext();

        if (sourceContext != null) {
            return pattern.getSourceContext().makeSourceLocation(location);
        }
    }

    if (where != null) {
        return new SourceLocation(where.getPath(), where.getLine());
    } else {
        return new SourceLocation(new File(context.getCClass().getSourceFile()), location.getStart());
    }
}