本文整理汇总了Java中com.sun.javadoc.Doc.position方法的典型用法代码示例。如果您正苦于以下问题:Java Doc.position方法的具体用法?Java Doc.position怎么用?Java Doc.position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.Doc
的用法示例。
在下文中一共展示了Doc.position方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: error
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
void error(Doc d, String s) {
SourcePosition sp = d != null ? d.position() : null;
if (sp != null) {
root.printError(sp, s);
} else {
root.printError(s);
}
okSoFar = false;
}
示例2: info
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
void info(Doc d, String s) {
if (verbose) {
SourcePosition sp = d != null ? d.position() : null;
if (log != null) {
log.println((sp != null ? sp.toString() + " : " : "") + s);
log.flush();
}
if (sp != null) {
root.printNotice(sp, s);
} else {
root.printNotice(s);
}
}
}
示例3: notice
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
void notice(Doc d, String s) {
SourcePosition sp = d != null ? d.position() : null;
if (log != null) {
log.println((sp != null ? sp.toString() + " : " : "") + s);
log.flush();
}
if (sp != null) {
root.printNotice(sp, s);
} else {
root.printNotice(s);
}
}
示例4: getTag
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
private static Tag[] getTag(Doc doc, String name, boolean check) {
Tag[] tags = doc.tags(name);
if (check && tags.length <= 0) {
throw new IllegalStateException("api doc:Tag[@"+name+"] must requied in position: " + doc.position());
}
if (tags.length <= 0) {
return null;
} else {
return tags;
}
}
示例5: GlobalPosition
import com.sun.javadoc.Doc; //导入方法依赖的package包/类
/**
* Initiates a new global source position based on the specified javadoc element.
* This global position will be active until it is closed or another global position is initiated (although closing
* that will restore this position).<br>
* Because it is important to always open / close in a stack-like fashion, it is advised to only create new
* <code>GlobalPosition</code> objects within try-with-resources constructions. This ensures proper unfolding of
* the global position even in case of exceptions.
*
* @param doc The javadoc element to be used as current global position.
*/
public GlobalPosition(Doc doc) {
this(doc != null ? doc.position() : null);
}