private static void addEvaluatedSelectItems(List <SelectItem> result, FilterItem item) { FilterItem[] orItems = item.getChildItems(); if (orItems != null) { foreach (FilterItem filterItem in orItems) { addEvaluatedSelectItems(result, filterItem); } } SelectItem selectItem = item.getSelectItem(); if (selectItem != null && !result.Contains(selectItem)) { result.Add(selectItem); } Object operand = item.getOperand(); if (operand != null && operand is SelectItem && !result.Contains((SelectItem)operand)) { result.Add((SelectItem)operand); } } // addEvaluatedSelectItems()
private FilterItem copyFilterItem(FilterItem item, Object[] values, NAtomicInteger parameterIndex) { if (item.isCompoundFilter()) { FilterItem[] childItems = item.getChildItems(); FilterItem[] newChildItems = new FilterItem[childItems.Length]; for (int i = 0; i < childItems.Length; i++) { FilterItem childItem = childItems[i]; FilterItem newChildItem = copyFilterItem(childItem, values, parameterIndex); newChildItems[i] = newChildItem; } NList <FilterItem> elements = new NList <FilterItem>(); foreach (FilterItem element in newChildItems) { elements.Add(element); } FilterItem newFilter = new FilterItem(item.getLogicalOperator(), elements); return(newFilter); } else { if (item.getOperand() is QueryParameter) { Object newOperand = values[parameterIndex.getAndIncrement()]; FilterItem newFilter = new FilterItem(item.getSelectItem(), item.getOperator(), newOperand); return(newFilter); } else { return(item); } } } // copyFilterItem()
private void buildParameterFromFilterItem(List <QueryParameter> parameters, FilterItem item) { if (item.isCompoundFilter()) { FilterItem[] childItems = item.getChildItems(); foreach (FilterItem childItem in childItems) { buildParameterFromFilterItem(parameters, childItem); } } else { if (item.getOperand() is QueryParameter) { parameters.Add((QueryParameter)item.getOperand()); } } }