本文整理汇总了Java中org.eclipse.xtext.diagnostics.Severity.IGNORE属性的典型用法代码示例。如果您正苦于以下问题:Java Severity.IGNORE属性的具体用法?Java Severity.IGNORE怎么用?Java Severity.IGNORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.xtext.diagnostics.Severity
的用法示例。
在下文中一共展示了Severity.IGNORE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stringToSeverity
public Severity stringToSeverity(String severityAsString) {
if (severityAsString == null)
throw new IllegalArgumentException("Severity as string was null");
if (severityAsString.equals(SEVERITY_ERROR)) {
return Severity.ERROR;
}
if (severityAsString.equals(SEVERITY_WARNING)) {
return Severity.WARNING;
}
if (severityAsString.equals(SEVERITY_INFO)) {
return Severity.INFO;
}
if (severityAsString.equals(SEVERITY_IGNORE)) {
return Severity.IGNORE;
}
throw new IllegalArgumentException("Unknown severity '"+severityAsString+"'.");
}
示例2: checkOppositeReferenceUsed
@Check
public void checkOppositeReferenceUsed(Assignment assignment) {
Severity severity = getIssueSeverities(getContext(), getCurrentObject()).getSeverity(BIDIRECTIONAL_REFERENCE);
if (severity == null || severity == Severity.IGNORE) {
// Don't perform any check if the result is ignored
return;
}
EClassifier classifier = GrammarUtil.findCurrentType(assignment);
if (classifier instanceof EClass) {
EStructuralFeature feature = ((EClass) classifier).getEStructuralFeature(assignment.getFeature());
if (feature instanceof EReference) {
EReference reference = (EReference) feature;
if (reference.getEOpposite() != null && !(reference.isContainment() || reference.isContainer())) {
addIssue("The feature '" + assignment.getFeature() + "' is a bidirectional reference."
+ " This may cause problems in the linking process.",
assignment, XtextPackage.eINSTANCE.getAssignment_Feature(), BIDIRECTIONAL_REFERENCE);
}
}
}
}
示例3: validateUnhandledExceptions
protected boolean validateUnhandledExceptions(IAcceptor<? super AbstractDiagnostic> result) {
if (getFeature() instanceof JvmExecutable) {
JvmExecutable executable = (JvmExecutable) getFeature();
if (getUnhandledExceptionSeverity(executable) != Severity.IGNORE) {
if (!executable.getExceptions().isEmpty()) {
return validateUnhandledExceptions(executable, result);
}
}
}
return true;
}
示例4: getSeverity
/**
* @return the Severity for the given severity code. Never returns <code>null</code>
*/
public Severity getSeverity(String code) {
if (!configurableIssueCodes.containsKey(code)) {
log.error("Configurable issue code '" + code + "' is not registered. Check the binding for " + ConfigurableIssueCodesProvider.class.getName());
return Severity.IGNORE;
}
final String value = preferenceValues.getPreference(configurableIssueCodes.get(code));
try {
return converter.stringToSeverity(value);
} catch (IllegalArgumentException e) {
log.error(e.getMessage(), e);
return Severity.IGNORE;
}
}
示例5: isIgnored
public boolean isIgnored(String code) {
return getSeverity(code) == Severity.IGNORE;
}