Beispiel #1
0
 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();
 }
Beispiel #2
0
 public static RuleNames tryGetRuleNames(AbstractRule rule) {
   Adapter adapter = (Adapter) EcoreUtil.getAdapter(rule.eAdapters(), RuleNames.class);
   if (adapter == null) {
     return null;
   }
   return adapter.getRuleNames();
 }