本文整理汇总了Java中com.sun.tools.apt.mirror.util.SourcePositionImpl类的典型用法代码示例。如果您正苦于以下问题:Java SourcePositionImpl类的具体用法?Java SourcePositionImpl怎么用?Java SourcePositionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourcePositionImpl类属于com.sun.tools.apt.mirror.util包,在下文中一共展示了SourcePositionImpl类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: printError
import com.sun.tools.apt.mirror.util.SourcePositionImpl; //导入依赖的package包/类
/**
* {@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);
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:13,代码来源:MessagerImpl.java
示例2: printWarning
import com.sun.tools.apt.mirror.util.SourcePositionImpl; //导入依赖的package包/类
/**
* {@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);
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:13,代码来源:MessagerImpl.java
示例3: printNotice
import com.sun.tools.apt.mirror.util.SourcePositionImpl; //导入依赖的package包/类
/**
* {@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);
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:13,代码来源:MessagerImpl.java
示例4: getPosition
import com.sun.tools.apt.mirror.util.SourcePositionImpl; //导入依赖的package包/类
/**
* {@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);
}
开发者ID:unktomi,项目名称:form-follows-function,代码行数:18,代码来源:DeclarationImpl.java
注:本文中的com.sun.tools.apt.mirror.util.SourcePositionImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论