本文整理汇总了Java中com.intellij.lang.annotation.ExternalAnnotator.apply方法的典型用法代码示例。如果您正苦于以下问题:Java ExternalAnnotator.apply方法的具体用法?Java ExternalAnnotator.apply怎么用?Java ExternalAnnotator.apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.lang.annotation.ExternalAnnotator
的用法示例。
在下文中一共展示了ExternalAnnotator.apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkFileWithExternalAnnotator
import com.intellij.lang.annotation.ExternalAnnotator; //导入方法依赖的package包/类
@NotNull
public static <Init,Result> ProblemDescriptor[] checkFileWithExternalAnnotator(@NotNull PsiFile file,
@NotNull InspectionManager manager,
boolean isOnTheFly,
@NotNull ExternalAnnotator<Init,Result> annotator) {
if (isOnTheFly) {
// ExternalAnnotator does this work
return ProblemDescriptor.EMPTY_ARRAY;
}
Init info = annotator.collectInformation(file);
if (info != null) {
Result annotationResult = annotator.doAnnotate(info);
if (annotationResult == null) {
return ProblemDescriptor.EMPTY_ARRAY;
}
AnnotationHolderImpl annotationHolder = new AnnotationHolderImpl(new AnnotationSession(file));
annotator.apply(file, annotationResult, annotationHolder);
return convertToProblemDescriptors(annotationHolder, manager, file);
}
return ProblemDescriptor.EMPTY_ARRAY;
}
示例2: processAnnotator
import com.intellij.lang.annotation.ExternalAnnotator; //导入方法依赖的package包/类
private static <X, Y> void processAnnotator(@NotNull XmlFile xmlFile, AnnotationHolderImpl holder, ExternalAnnotator<X, Y> annotator) {
X initial = annotator.collectInformation(xmlFile);
if (initial != null) {
Y result = annotator.doAnnotate(initial);
if (result != null) {
annotator.apply(xmlFile, result, holder);
}
}
}
示例3: applyRelevant
import com.intellij.lang.annotation.ExternalAnnotator; //导入方法依赖的package包/类
private void applyRelevant() {
for (ExternalAnnotator annotator : myAnnotator2DataMap.keySet()) {
final MyData data = myAnnotator2DataMap.get(annotator);
if (data != null && data.myAnnotationResult != null) {
annotator.apply(data.myPsiRoot, data.myAnnotationResult, myAnnotationHolder);
}
}
}
示例4: collectHighlighters
import com.intellij.lang.annotation.ExternalAnnotator; //导入方法依赖的package包/类
private void collectHighlighters() {
for (ExternalAnnotator annotator : myAnnotator2DataMap.keySet()) {
final MyData data = myAnnotator2DataMap.get(annotator);
if (data != null) {
annotator.apply(data.myPsiRoot, data.myAnnotationResult, myAnnotationHolder);
}
}
}