本文整理汇总了Java中com.google.javascript.rhino.JSDocInfo.getMarkers方法的典型用法代码示例。如果您正苦于以下问题:Java JSDocInfo.getMarkers方法的具体用法?Java JSDocInfo.getMarkers怎么用?Java JSDocInfo.getMarkers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.rhino.JSDocInfo
的用法示例。
在下文中一共展示了JSDocInfo.getMarkers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertAnnotationMarker
import com.google.javascript.rhino.JSDocInfo; //导入方法依赖的package包/类
/**
* Asserts that the index-th annotation marker of a given annotation name
* is found in the given JSDocInfo.
*
* @param jsdoc The JSDocInfo in which to search for the annotation marker.
* @param annotationName The name/type of the annotation for which to
* search. Example: "author" for an "@author" annotation.
* @param startLineno The expected starting line number of the marker.
* @param startCharno The expected character on the starting line.
* @param index The index of the marker.
* @return The marker found, for further testing.
*/
private JSDocInfo.Marker assertAnnotationMarker(JSDocInfo jsdoc,
String annotationName,
int startLineno,
int startCharno,
int index) {
Collection<JSDocInfo.Marker> markers = jsdoc.getMarkers();
assertTrue(markers.size() > 0);
int counter = 0;
for (JSDocInfo.Marker marker : markers) {
if (marker.annotation != null) {
if (annotationName.equals(marker.annotation.getItem())) {
if (counter == index) {
assertEquals(startLineno, marker.annotation.getStartLine());
assertEquals(startCharno,
marker.annotation.getPositionOnStartLine());
assertEquals(startLineno, marker.annotation.getEndLine());
assertEquals(startCharno + annotationName.length(),
marker.annotation.getPositionOnEndLine());
return marker;
}
counter++;
}
}
}
fail("No marker found");
return null;
}