public static RuleNames getRuleNames(AbstractRule rule) { Adapter adapter = (Adapter) EcoreUtil.getAdapter(rule.eAdapters(), RuleNames.class); if (adapter == null) { throw new IllegalStateException("Cannot find adapter"); } return adapter.getRuleNames(); }
public static RuleNames tryGetRuleNames(AbstractRule rule) { Adapter adapter = (Adapter) EcoreUtil.getAdapter(rule.eAdapters(), RuleNames.class); if (adapter == null) { return null; } return adapter.getRuleNames(); }