/** * Instantiate a chain of views. * @param parentViewable - parent view to add the chain to * @param viewFactories - is the view factories to use to make each view, or reuse and existing view * @param context - dependent services * @return chain of views instantiated */ protected static List<View> instantiateChain(Viewable parentViewable, List<ViewFactory> viewFactories, StatementContext context) { List<View> newViews = new LinkedList<View>(); Viewable parent = parentViewable; for (ViewFactory viewFactory : viewFactories) { // Create the new view object View currentView = viewFactory.makeView(context); newViews.add(currentView); parent.addView(currentView); // Next parent is the new view parent = currentView; } return newViews; }
public void setParentView(Viewable viewable) { if (viewable == null) { if (parentView != null) { parentView.removeView(dispatchChildView); } parentView = null; } else { parentView = viewable; parentView.addView(dispatchChildView); eventType = parentView.getEventType(); } }
private Viewable handleSimpleSelect(Viewable view, ResultSetProcessor resultSetProcessor, StatementContext statementContext) throws ExprValidationException { Viewable finalView = view; // Add filter view that evaluates the filter expression if (statementSpec.getFilterRootNode() != null) { FilterExprView filterView = new FilterExprView(statementSpec.getFilterRootNode()); finalView.addView(filterView); finalView = filterView; } OutputProcessView selectView = OutputProcessViewFactory.makeView(resultSetProcessor, statementSpec, statementContext, services.getInternalEventRouter()); finalView.addView(selectView); finalView = selectView; return finalView; }
streamViews[i].addView(buffer); buffer.setObserver(joinStatementDispatch); preloadMethod.setBuffer(buffer, i);