Java 类org.eclipse.xtext.util.XtextSwitch 实例源码

项目:xtext-core    文件:XtextLinkingDiagnosticMessageProvider.java   
@Override
public DiagnosticMessage getUnresolvedProxyMessage(final ILinkingDiagnosticContext context) {
    DiagnosticMessage diagnosticMessage = new XtextSwitch<DiagnosticMessage>() {
        @Override
        public DiagnosticMessage caseRuleCall(RuleCall ruleCall) {
            return new DiagnosticMessage(context.getLinkText()+" cannot be resolved to a rule", Severity.ERROR,
                    UNRESOLVED_RULE, context.getLinkText());
        }

    }.doSwitch(context.getContext());
    return diagnosticMessage != null ? diagnosticMessage : super.getUnresolvedProxyMessage(context);
}