Example usage for org.aspectj.bridge SourceLocation SourceLocation

List of usage examples for org.aspectj.bridge SourceLocation SourceLocation

Introduction

In this page you can find the example usage for org.aspectj.bridge SourceLocation SourceLocation.

Prototype

public SourceLocation(File file, int line) 

Source Link

Document

Same as SourceLocation(file, line, line, 0), except that column is not rendered during toString()

Usage

From source file:org.caesarj.compiler.asm.CaesarAsmBuilder.java

License:Open Source License

/**
 * //from  w  ww. jav a2  s . c om
 */
private ISourceLocation makeLocation(TokenReference ref) {
    String fileName = new String(ref.getFile());

    return new SourceLocation(new File(fileName), ref.getLine());
}

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

License:Open Source License

public ISourceLocation makeSourceLocation(IHasPosition position) {
    if (position instanceof Advice) {
        return new SourceLocation(getSourceFile(), position.getEnd());
    } else {//  ww w. j  a v  a  2 s. co  m
        return super.makeSourceLocation(position);
    }
}

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

License:Open Source License

/**
 * Creates the ISourceLocation for the given location.
 *///from  w  w w. ja  va  2s  . c  o  m
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());
    }
}

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

License:Open Source License

/**
 * @see org.aspectj.weaver.ISourceContext#makeSourceLocation(IHasPosition)
 *//*ww  w . j a  v  a2  s . c o m*/
public ISourceLocation makeSourceLocation(IHasPosition position) {
    return new SourceLocation(tokenReference.getPath(), tokenReference.getLine());
}

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

License:Open Source License

/**
 * @see org.aspectj.weaver.ISourceContext#makeSourceLocation(int)
 *//*from  w  w  w.  j a v a2 s.  c  om*/
public ISourceLocation makeSourceLocation(int line) {
    return new SourceLocation(tokenReference.getPath(), tokenReference.getLine());
}