@Override public String getUri() { if (getOriginal() instanceof IUriMember) { return ((IUriMember) getOriginal()).getUri(); } else { throw new IllegalStateException("Implementation doesn't support methods other than ExecutableRulesMethod!"); } }
@Override public String getUri() { if (getOriginal() instanceof IUriMember) { return ((IUriMember) getOriginal()).getUri(); } else { throw new IllegalStateException("Implementation doesn't support methods other than ExecutableRulesMethod!"); } }
/** * Gets all tests for current table. */ public TableDescription[] getAllTests() { if (allTests == null) { return null; } List<TableDescription> tableDescriptions = new ArrayList<TableDescription>(allTests.length); for (IOpenMethod test : allTests) { String tableUri = ((IUriMember) test).getUri(); TableSyntaxNode syntaxNode = (TableSyntaxNode) test.getInfo().getSyntaxNode(); tableDescriptions.add(new TableDescription(tableUri, syntaxNode.getId(), getTestName(test))); } Collections.sort(tableDescriptions, new Comparator<TableDescription>() { @Override public int compare(TableDescription o1, TableDescription o2) { return o1.getName().compareTo(o2.getName()); } }); return tableDescriptions.toArray(new TableDescription[tableDescriptions.size()]); }
/** * Gets all tests for current table. */ public TableDescription[] getAllTests() { if (allTests == null) { return null; } List<TableDescription> tableDescriptions = new ArrayList<>(allTests.length); for (IOpenMethod test : allTests) { String tableUri = ((IUriMember) test).getUri(); TableSyntaxNode syntaxNode = (TableSyntaxNode) test.getInfo().getSyntaxNode(); tableDescriptions.add(new TableDescription(tableUri, syntaxNode.getId(), getTestName(test))); } Collections.sort(tableDescriptions, new Comparator<TableDescription>() { @Override public int compare(TableDescription o1, TableDescription o2) { return o1.getName().compareTo(o2.getName()); } }); return tableDescriptions.toArray(new TableDescription[0]); }
private static String getTableUri(IOpenMethod method) { try { if (method instanceof IUriMember) { return ((IUriMember) method).getUri(); } else if (method instanceof OverloadedMethodsDispatcherTable) { return ((OverloadedMethodsDispatcherTable) method).getDispatcherTable().getUri(); } else if (method instanceof MatchingOpenMethodDispatcher) { MatchingOpenMethodDispatcher matchingOpenMethodDispatcher = (MatchingOpenMethodDispatcher) method; if (matchingOpenMethodDispatcher.getCandidates().size() == 1) { return getTableUri(matchingOpenMethodDispatcher.getCandidates().get(0)); } else { return matchingOpenMethodDispatcher.getDispatcherTable().getUri(); } } else if (method.getInfo() != null) { return method.getInfo().getSourceUrl(); } else { return null; } } catch (Exception e) { return null; } }