code: public SerializedView saveSerializedView(FacesContext context) {
  
          context.getAttributes().put(IS_CALLED_FROM_API_CLASS, Boolean.TRUE);
          Object stateObj = null;
          try {
              stateObj = saveView(context);
          } finally {
              context.getAttributes().remove(IS_CALLED_FROM_API_CLASS);
          }
  
          SerializedView result = null;
          if (null != stateObj) {
              if (stateObj instanceof Object[]) {
                  Object [] state = (Object[]) stateObj;
                  if (state.length == 2) {
                      result = new SerializedView(state[0], state[1]);
                  }
              }
          } 
          return result;
      }
docs: <p>Return the tree structure and component state information for the
  view contained in the specified {@link FacesContext} instance as an
  object of type <code>StateManager.SerializedView</code>.  If there
  is no state information to be saved, return <code>null</code>
  instead.</p>
  <p/>
  <p>Components may opt out of being included in the serialized view
  by setting their <code>transient</code> property to <code>true</code>.
  This must cause the component itself, as well as all of that component's
  children and facets, to be omitted from the saved  tree structure
  and component state information.</p>
  <p/>
  <p>This method must also enforce the rule that, for components with
  non-null <code>id</code>s, all components that are descendants of the
  same nearest {@link NamingContainer} must have unique identifiers.</p>
  
  @param context {@link FacesContext} for the current request
  
  @throws IllegalStateException if more than one component or
  facet within the same {@link NamingContainer} in this view has
  the same non-<code>null</code> component id
  @deprecated this has been replaced by {@link #saveView}.  The
  default implementation calls <code>saveView</code> and inspects the
  return.  If the return is an <code>Object []</code>, it casts the
  result to an <code>Object []</code> wrapping the first and second
  elements in an instance of {@link SerializedView}, which it then
  returns.  Otherwise, it returns <code>null</code>