本文整理匯總了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);
}