Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   *
   * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
   *
   * The contents of this file are subject to the terms of either the GNU
   * General Public License Version 2 only ("GPL") or the Common Development
   * and Distribution License("CDDL") (collectively, the "License").  You
   * may not use this file except in compliance with the License.  You can
  * obtain a copy of the License at
  * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
  * or packager/legal/LICENSE.txt.  See the License for the specific
  * language governing permissions and limitations under the License.
  *
  * When distributing the software, include this License Header Notice in each
  * file and include the License file at packager/legal/LICENSE.txt.
  *
  * GPL Classpath Exception:
  * Oracle designates this particular file as subject to the "Classpath"
  * exception as provided by Oracle in the GPL Version 2 section of the License
  * file that accompanied this code.
  *
  * Modifications:
  * If applicable, add the following below the License Header, with the fields
  * enclosed by brackets [] replaced by your own identifying information:
  * "Portions Copyright [year] [name of copyright owner]"
  *
  * Contributor(s):
  * If you wish your version of this file to be governed by only the CDDL or
  * only the GPL Version 2, indicate your decision by adding "[Contributor]
  * elects to include this software in this distribution under the [CDDL or GPL
  * Version 2] license."  If you don't indicate a single choice of license, a
  * recipient has the option to distribute your version of this file under
  * either the CDDL, the GPL Version 2 or to extend the choice of license to
  * its licensees as provided above.  However, if you add GPL Version 2 code
  * and therefore, elected the GPL Version 2 license, then the option applies
  * only if the new code is made subject to such option by the copyright
  * holder.
  */
 
 package javax.faces.context;
 
 import java.util.Map;
 import java.util.List;
 

Provides a simple implementation of FacesContext that can be subclassed by developers wishing to provide specialized behavior to an existing FacesContext instance. The default implementation of all methods is to call through to the wrapped FacesContext instance.

Usage: extend this class and override getWrapped() to return the instance being wrapping.

Since:
2.0
 
 public abstract class FacesContextWrapper extends FacesContext implements FacesWrapper<FacesContext> {
 
 
     // ----------------------------------------------- Methods from FacesWrapper
 

    

Returns:
the wrapped FacesContext instance
See also:
javax.faces.FacesWrapper.getWrapped()
 
     public abstract FacesContext getWrapped();
 
 
     // ----------------------------------------------- Methods from FacesContext
 

    

The default behavior of this method is to call FacesContext.getApplication() on the wrapped FacesContext object.

 
     public Application getApplication() {
         return getWrapped().getApplication();
     }

    

The default behavior of this method is to call FacesContext.getClientIdsWithMessages() on the wrapped FacesContext object.

        return getWrapped().getClientIdsWithMessages();
    }

    

The default behavior of this method is to call FacesContext.getExternalContext() on the wrapped FacesContext object.

        return getWrapped().getExternalContext();
    }

    

The default behavior of this method is to call FacesContext.getMaximumSeverity() on the wrapped FacesContext object.

        return getWrapped().getMaximumSeverity();
    }

    

The default behavior of this method is to call FacesContext.getMessages() on the wrapped FacesContext object.

    public Iterator<FacesMessagegetMessages() {
        return getWrapped().getMessages();
    }

    

The default behavior of this method is to call FacesContext.getMessages(java.lang.String) on the wrapped FacesContext object.

    public Iterator<FacesMessagegetMessages(String clientId) {
        return getWrapped().getMessages(clientId);
    }

    

The default behavior of this method is to call FacesContext.getRenderKit() on the wrapped FacesContext object.

    public RenderKit getRenderKit() {
        return getWrapped().getRenderKit();
    }

    

The default behavior of this method is to call FacesContext.getRenderResponse() on the wrapped FacesContext object.

    public boolean getRenderResponse() {
        return getWrapped().getRenderResponse();
    }

    

The default behavior of this method is to call FacesContext.getResponseComplete() on the wrapped FacesContext object.

    public boolean getResponseComplete() {
        return getWrapped().getResponseComplete();
    }

    

The default behavior of this method is to call FacesContext.getResponseStream() on the wrapped FacesContext object.

    public ResponseStream getResponseStream() {
        return getWrapped().getResponseStream();
    }

    
    public void setResponseStream(ResponseStream responseStream) {
        getWrapped().setResponseStream(responseStream);
    }

    

The default behavior of this method is to call FacesContext.getResponseWriter() on the wrapped FacesContext object.

    public ResponseWriter getResponseWriter() {
        return getWrapped().getResponseWriter();
    }

    
    public void setResponseWriter(ResponseWriter responseWriter) {
        getWrapped().setResponseWriter(responseWriter);
    }

    

The default behavior of this method is to call FacesContext.getViewRoot() on the wrapped FacesContext object.

    public UIViewRoot getViewRoot() {
        return getWrapped().getViewRoot();
    }

    
    public void setViewRoot(UIViewRoot root) {
        getWrapped().setViewRoot(root);
    }

    
    public void addMessage(String clientIdFacesMessage message) {
        getWrapped().addMessage(clientIdmessage);
    }

    

The default behavior of this method is to call FacesContext.isReleased() on the wrapped FacesContext object.

Since:
2.1
See also:
FacesContext.isReleased()
    public boolean isReleased() {
    }


    

The default behavior of this method is to call FacesContext.release() on the wrapped FacesContext object.

    public void release() {
        getWrapped().release();
    }

    

The default behavior of this method is to call FacesContext.renderResponse() on the wrapped FacesContext object.

    public void renderResponse() {
        getWrapped().renderResponse();
    }

    

The default behavior of this method is to call FacesContext.responseComplete() on the wrapped FacesContext object.

    public void responseComplete() {
        getWrapped().responseComplete();
    }

    

The default behavior of this method is to call FacesContext.getAttributes() on the wrapped FacesContext object.

    @Override
    public Map<ObjectObjectgetAttributes() {
        return getWrapped().getAttributes();
    }

    

The default behavior of this method is to call FacesContext.getPartialViewContext() ()} on the wrapped FacesContext object.

    @Override
        return getWrapped().getPartialViewContext();
    }

    

The default behavior of this method is to call FacesContext.getELContext() on the wrapped FacesContext object.

    @Override
    public ELContext getELContext() {
        return getWrapped().getELContext();
    }


    

The default behavior of this method is to call FacesContext.getExceptionHandler() on the wrapped FacesContext object.

    @Override
        return getWrapped().getExceptionHandler();
    }

    
    @Override
    public void setExceptionHandler(ExceptionHandler exceptionHandler) {
        getWrapped().setExceptionHandler(exceptionHandler);
    }

    

The default behavior of this method is to call FacesContext.getMessageList() on the wrapped FacesContext object.

    @Override
    public List<FacesMessagegetMessageList() {
        return getWrapped().getMessageList();
    }

    

The default behavior of this method is to call FacesContext.getMessageList(java.lang.String) on the wrapped FacesContext object.

    @Override
    public List<FacesMessagegetMessageList(String clientId) {
        return getWrapped().getMessageList(clientId);
    }

    

The default behavior of this method is to call FacesContext.isPostback() on the wrapped FacesContext object.

    @Override
    public boolean isPostback() {
        return getWrapped().isPostback();
    }

    

The default behavior of this method is to call FacesContext.getCurrentPhaseId() on the wrapped FacesContext object.

    @Override
    public PhaseId getCurrentPhaseId() {
        return getWrapped().getCurrentPhaseId();
    }

    
    @Override
    public void setCurrentPhaseId(PhaseId currentPhaseId) {
        getWrapped().setCurrentPhaseId(currentPhaseId);
    }


    

The default behavior of this method is to call FacesContext.isValidationFailed() on the wrapped FacesContext object.

    @Override
    public boolean isValidationFailed() {
        return getWrapped().isValidationFailed();
    }


    

The default behavior of this method is to call FacesContext.validationFailed() on the wrapped FacesContext object.

    @Override
    public void validationFailed() {
        getWrapped().validationFailed();
    }


    

The default behavior of this method is to call FacesContext.setProcessingEvents(boolean) on the wrapped FacesContext object.

    @Override
    public void setProcessingEvents(boolean processingEvents) {
        getWrapped().setProcessingEvents(processingEvents);
    }


    

The default behavior of this method is to call FacesContext.isProcessingEvents() on the wrapped FacesContext object.

    @Override
    public boolean isProcessingEvents() {
        return getWrapped().isProcessingEvents();
    }


    
    @Override
    public boolean isProjectStage(ProjectStage stage) {
        return getWrapped().isProjectStage(stage);    
    }
New to GrepCode? Check out our FAQ X