@Override public void addMethod(IOpenMethod candidate) { delegate.addMethod(candidate); }
public MatchingOpenMethodDispatcher(IOpenMethod method, XlsModuleOpenClass moduleOpenClass) { super(); decorate(method); this.moduleOpenClass = moduleOpenClass; }
@Override public List<IOpenMethod> getCandidates() { return delegate.getCandidates(); }
@Override public IMemberMetaInfo getInfo() { if (getCandidates().size() == 1) { return getCandidates().get(0).getInfo(); } return getDispatcherTable().getMember().getInfo(); }
List<IOpenMethod> notPriorMethods = new ArrayList<IOpenMethod>(); List<String> notNullPropertyNames = getNotNullPropertyNames(context); } else { ITableProperties candidateProperties = PropertiesHelper.getTableProperties(candidate); int cmp = compareMaxMinPriorities(candidateProperties, mostPriorityProperties); if (cmp < 0) { notPriorMethods.addAll(mostPriority);
@Override public IOpenClass getDeclaringClass() { return delegate.getDeclaringClass(); }
@Override public IOpenMethod getDecisionTableOpenMethod() { return delegate.getDecisionTableOpenMethod(); }
@Override public IMemberMetaInfo getInfo() { return delegate.getInfo(); }
@Override public String getDisplayName(int mode) { return delegate.getDisplayName(mode); }
@Override public TableSyntaxNode getDispatcherTable() { return delegate.getDispatcherTable(); }
private OpenMethodDispatcher getOpenMethodDispatcher(IOpenMethod method) { OpenMethodDispatcher decorator; IOpenMethod decorated = undecorateForMultimoduleDispatching(method); if (useDescisionTableDispatcher) { decorator = new OverloadedMethodsDispatcherTable(decorated, this); } else { decorator = new MatchingOpenMethodDispatcher(decorated, this); } return decorator; }
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; } }
@Override public IOpenClass getType() { //Use types from declaring types. For customspreadsheetresult types. IOpenClass type = getDeclaringClass().findType(super.getType().getName()); if (type == null){ return super.getType(); } return type; }
private IOpenMethod getMember() { // as we have a group of overloaded methods, we need to take one it`s // member to get all common settings for the whole group return dispatcher.getCandidates().get(0); }
/** * Gets properties values from methods in group that will be * used to build dispatcher table by dimensional properties. * * @return properties values from tables in group. */ private List<ITableProperties> getMethodsProperties() { List<ITableProperties> propertiesValues = new ArrayList<>(); for (IOpenMethod method : dispatcher.getCandidates()) { propertiesValues.add(PropertiesHelper.getTableProperties(method)); } return propertiesValues; }
private IBindingContext createContextWithAuxiliaryMethods() { List<IOpenMethod> candidates = dispatcher.getCandidates(); final Map<MethodKey, IOpenMethod> auxiliaryMethods = new HashMap<>(candidates.size()); for (int i = 0; i < candidates.size(); i++) { IOpenMethod auxiliaryMethod = generateAuxiliaryMethod(candidates.get(i), i); auxiliaryMethods.put(new MethodKey(auxiliaryMethod), auxiliaryMethod); } return new InternalBindingContextDelegator(moduleContext, auxiliaryMethods); }