StateManager stateManager = context.getApplication().getStateManager(); view = stateManager.new SerializedView(stateArray[0], stateArray[1]); } else {
StateManager stateManager = context.getApplication().getStateManager(); view = stateManager.new SerializedView(stateArray[0], stateArray[1]); } else {
Object stateArray[] = (Object[]) state; if (2 == stateArray.length) { SerializedView view = new SerializedView(stateArray[0], stateArray[1]); writeState(context, view);
Object stateArray[] = (Object[]) state; if (stateArray.length == 2) { SerializedView view = new SerializedView(stateArray[0], stateArray[1]); writeState(context, view);
Object [] state = (Object[]) stateObj; if (state.length == 2) { result = new SerializedView(state[0], state[1]);
Object stateArray[] = (Object[]) state; if (stateArray.length == 2) { SerializedView view = new SerializedView(stateArray[0], stateArray[1]); writeState(context, view);
Object stateArray[] = (Object[]) state; if (stateArray.length == 2) { SerializedView view = new SerializedView(stateArray[0], stateArray[1]); writeState(context, view);
Object [] state = (Object[]) stateObj; if (state.length == 2) { result = new SerializedView(state[0], state[1]);
return new SerializedView(serializedViewArray[0], new Object[0]); return new SerializedView(serializedViewArray[0], serializedViewArray[1]);
Object stateArray[] = (Object[]) state; if (2 == stateArray.length) { SerializedView view = new SerializedView(stateArray[0], stateArray[1]); writeState(context, view);
return new SerializedView(serializedViewArray[0], new Object[0]); return new SerializedView(serializedViewArray[0], serializedViewArray[1]);
return new SerializedView(serializedViewArray[0], new Object[0]); return new SerializedView(serializedViewArray[0], serializedViewArray[1]);
public void writeState(FacesContext context, Object state) throws IOException{ SerializedView view; if (state instanceof SerializedView) { view = (SerializedView) state; } else if (state instanceof Object[]) { Object[] structureAndState = (Object[]) state; if (structureAndState.length == 2) { Object structureObj = structureAndState[0]; Object stateObj = structureAndState[1]; StateManager stateManager = context.getApplication().getStateManager(); view = stateManager.new SerializedView(structureObj, stateObj); } else { throw new IOException("The state should be an array of Object[] of lenght 2"); } } else { throw new IOException("The state should be an array of Object[] of lenght 2, or a SerializedView instance"); } writeState(context, view); }
/** * Associate the provided state object with the current response being generated. * <p> * When client-side state is enabled, it is expected that method writes the data contained in the state parameter to * the response somehow. * <p> * When server-side state is enabled, at most a "token" is expected to be written. * <p> * This method should be overridden by subclasses. It is not abstract because a default implementation is provided * that forwards to the old writeState method; this allows subclasses of StateManager written using the JSF1.1 API * to continue to work. * <p> * * @since 1.2 */ public void writeState(FacesContext context, Object state) throws IOException { if (!(state instanceof Object[])) { return; } Object[] structureAndState = (Object[]) state; if (structureAndState.length < 2) { return; } writeState(context, new StateManager.SerializedView(structureAndState[0], structureAndState[1])); }
public void writeState(FacesContext context, Object state) throws IOException { SerializedView view; if (state instanceof SerializedView) { view = (SerializedView)state; } else if (state instanceof Object[]) { Object[] structureAndState = (Object[])state; if (structureAndState.length == 2) { Object structureObj = structureAndState[0]; Object stateObj = structureAndState[1]; StateManager stateManager = context.getApplication().getStateManager(); view = stateManager.new SerializedView(structureObj, stateObj); } else { throw new IOException("The state should be an array of Object[] of lenght 2"); } } else { throw new IOException("The state should be an array of Object[] of lenght 2, or a SerializedView instance"); } writeState(context, view); }
/** * Associate the provided state object with the current response being generated. * <p> * When client-side state is enabled, it is expected that method writes the data contained in the * state parameter to the response somehow. * <p> * When server-side state is enabled, at most a "token" is expected to be written. * <p> * This method should be overridden by subclasses. It is not abstract because a default * implementation is provided that forwards to the old writeState method; this allows * subclasses of StateManager written using the JSF1.1 API to continue to work. * <p> * @since 1.2 */ public void writeState(FacesContext context, Object state) throws IOException { if (!(state instanceof Object[])) return; Object[] structureAndState = (Object[])state; if (structureAndState.length < 2) return; writeState(context, new StateManager.SerializedView(structureAndState[0], structureAndState[1])); }
/** * Invokes getTreeStructureToSave and getComponentStateToSave, then return an object that wraps the two resulting * objects. This object can then be passed to method writeState. * <p> * Deprecated; use saveView instead. * * @deprecated */ public StateManager.SerializedView saveSerializedView(FacesContext context) { Object savedView = saveView(context); if (savedView != null && savedView instanceof Object[]) { Object[] structureAndState = (Object[]) savedView; if (structureAndState.length == 2) { return new StateManager.SerializedView(structureAndState[0], structureAndState[1]); } } return null; }
/** * JSF 1.1 version of state saving */ public javax.faces.application.StateManager.SerializedView saveSerializedView(FacesContext context) { if (context.getViewRoot().isTransient()) { return null; } if (!JsfUtils.isFlowRequest()) { return delegate.saveSerializedView(context); } SerializedView view = (SerializedView) saveView(context); return new javax.faces.application.StateManager.SerializedView(view.treeStructure, view.componentState); }
protected SerializedView createSerializedView(FacesContext context, UIViewRoot viewRoot) { Object struct = getTreeStructureToSave(context, viewRoot); Object state = getComponentStateToSave(context, viewRoot); return new SerializedView(struct, state); }
protected SerializedView createSerializedView(FacesContext context) { Object struct = getTreeStructureToSave(context); Object state = getComponentStateToSave(context); return new SerializedView(struct, state); }