本文整理汇总了Java中org.eclipse.xtext.validation.Issue.getUriToProblem方法的典型用法代码示例。如果您正苦于以下问题:Java Issue.getUriToProblem方法的具体用法?Java Issue.getUriToProblem怎么用?Java Issue.getUriToProblem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.validation.Issue
的用法示例。
在下文中一共展示了Issue.getUriToProblem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachData
import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
public void attachData(Resource resource) {
if (findDataAdapter(resource) != null) {
return;
}
List<Issue> issues = collectIssues(resource);
Data adapter = new Data();
for (Issue issue : issues) {
URI uriToProblem = issue.getUriToProblem();
if (uriToProblem != null && uriToProblem.trimFragment().equals(resource.getURI())) {
EObject erroneousElement = resource.getEObject(uriToProblem.fragment());
adapter.addIssue(erroneousElement, issue);
for(EObject jvmElement: associations.getJvmElements(erroneousElement)) {
adapter.addIssue(jvmElement, issue);
}
}
}
resource.eAdapters().add(adapter);
}
示例2: doGetIssuesAsString
import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
protected StringBuilder doGetIssuesAsString(Resource resource, final Iterable<Issue> issues, StringBuilder result) {
for (Issue issue : issues) {
URI uri = issue.getUriToProblem();
result.append(issue.getSeverity());
result.append(" (");
result.append(issue.getCode());
result.append(") '");
result.append(issue.getMessage());
result.append("'");
if (uri != null) {
EObject eObject = resource.getResourceSet().getEObject(uri, true);
result.append(" on ");
result.append(eObject.eClass().getName());
}
result.append(", offset " + issue.getOffset() + ", length " + issue.getLength());
result.append("\n");
}
return result;
}
示例3: accept
import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
public void accept(final Issue issue, final String label, final String description, final String image, final ICoreSemanticModification semanticModification) {
CoreSemanticModificationWrapper modificationWrapper = new CoreSemanticModificationWrapper(issue.getUriToProblem(), semanticModification);
issueResolutions.add(new CoreIssueResolution(label, description, image, modificationContextFactory.createModificationContext(issue), modificationWrapper));
}
示例4: uri
import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
/**
* Creates a builder for an issue's URI.
*
* @see Issue#getUriToProblem()
*
* @return an instance of {@link URIPropertyMatcher} that can be used to specify the actual expectation
*/
public URIPropertyMatcherBuilder uri() {
return new URIPropertyMatcherBuilder(this, "URI", (Issue issue) -> issue.getUriToProblem());
}