use of com.sun.tools.apt.mirror.util.SourcePositionImpl in project ceylon-compiler by ceylon.
the class MessagerImpl method printError.
/**
* {@inheritDoc}
*/
public void printError(SourcePosition pos, String msg) {
if (pos instanceof SourcePositionImpl) {
SourcePositionImpl posImpl = (SourcePositionImpl) pos;
JavaFileObject prev = bark.useSource(posImpl.getSource());
bark.aptError(posImpl.getJavacPosition(), "Messager", msg);
bark.useSource(prev);
} else
printError(msg);
}
use of com.sun.tools.apt.mirror.util.SourcePositionImpl in project ceylon-compiler by ceylon.
the class MessagerImpl method printNotice.
/**
* {@inheritDoc}
*/
public void printNotice(SourcePosition pos, String msg) {
if (pos instanceof SourcePositionImpl) {
SourcePositionImpl posImpl = (SourcePositionImpl) pos;
JavaFileObject prev = bark.useSource(posImpl.getSource());
bark.aptNote(posImpl.getJavacPosition(), "Messager", msg);
bark.useSource(prev);
} else
printNotice(msg);
}
use of com.sun.tools.apt.mirror.util.SourcePositionImpl in project ceylon-compiler by ceylon.
the class DeclarationImpl method getPosition.
/**
* {@inheritDoc}
*/
public SourcePosition getPosition() {
// Find the toplevel. From there use a tree-walking utility
// that finds the tree for our symbol, and with it the position.
Env<AttrContext> enterEnv = getEnterEnv();
if (enterEnv == null)
return null;
JCTree.JCCompilationUnit toplevel = enterEnv.toplevel;
JavaFileObject sourcefile = toplevel.sourcefile;
if (sourcefile == null)
return null;
int pos = TreeInfo.positionFor(sym, toplevel);
return new SourcePositionImpl(sourcefile, pos, toplevel.lineMap);
}
use of com.sun.tools.apt.mirror.util.SourcePositionImpl in project ceylon-compiler by ceylon.
the class MessagerImpl method printWarning.
/**
* {@inheritDoc}
*/
public void printWarning(SourcePosition pos, String msg) {
if (pos instanceof SourcePositionImpl) {
SourcePositionImpl posImpl = (SourcePositionImpl) pos;
JavaFileObject prev = bark.useSource(posImpl.getSource());
bark.aptWarning(posImpl.getJavacPosition(), "Messager", msg);
bark.useSource(prev);
} else
printWarning(msg);
}
Aggregations