public void statementTreeViewInfoStateSetter(String courseState, Iterator<StatementTreeViewInfo> itr) { while(itr.hasNext()) { StatementTreeViewInfo statementTreeViewInfo = (StatementTreeViewInfo)itr.next(); statementTreeViewInfo.setState(courseState); List<ReqComponentInfo> reqComponents = statementTreeViewInfo.getReqComponents(); for(Iterator<ReqComponentInfo> it = reqComponents.iterator(); it.hasNext();) it.next().setState(courseState); statementTreeViewInfoStateSetter(courseState, statementTreeViewInfo.getStatements().iterator()); } } }
/** * This method will recursively set the state of all statements in the tree. * <p> * WARNING: you must call the statement service in order to update statements. * <p> * * @param state is the state we should set all statements in the tree to * @param statementTreeViewInfo the tree of statements * @throws Exception */ public static void updateStatementTreeViewInfoState(String state, StatementTreeViewInfo statementTreeViewInfo) { // Set the state on the statement tree itself statementTreeViewInfo.setState(state); // Get all the requirements components for this statement List<ReqComponentInfo> reqComponents = statementTreeViewInfo.getReqComponents(); // Loop over requirements and set the state for each requirement for(Iterator<ReqComponentInfo> it = reqComponents.iterator(); it.hasNext();) it.next().setState(state); // Loop over each statement and set the state for each statement (recursively calling this method) for(Iterator<StatementTreeViewInfo> itr = statementTreeViewInfo.getStatements().iterator(); itr.hasNext();) updateStatementTreeViewInfoState(state, (StatementTreeViewInfo)itr.next()); } /**
/** * This method will recursively set the state of all statements in the tree. * <p> * WARNING: you must call the statement service in order to update statements. * <p> * * @param state is the state we should set all statements in the tree to * @param statementTreeViewInfo the tree of statements * @throws Exception */ public static void updateStatementTreeViewInfoState(String state, StatementTreeViewInfo statementTreeViewInfo) { // Set the state on the statement tree itself statementTreeViewInfo.setState(state); // Get all the requirements components for this statement List<ReqComponentInfo> reqComponents = statementTreeViewInfo.getReqComponents(); // Loop over requirements and set the state for each requirement for(Iterator<ReqComponentInfo> it = reqComponents.iterator(); it.hasNext();) it.next().setState(state); // Loop over each statement and set the state for each statement (recursively calling this method) for(Iterator<StatementTreeViewInfo> itr = statementTreeViewInfo.getStatements().iterator(); itr.hasNext();) updateStatementTreeViewInfoState(state, (StatementTreeViewInfo)itr.next()); } /**
it.next().setState(state);
reqComp.setState(newState); for(ReqCompFieldInfo field:reqComp.getReqCompFields()){ field.setId(null);