📄 phase.java
字号:
/* * Copyright 2002-2004 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package de.mindmatters.faces.lifecycle;import javax.faces.context.FacesContext;import javax.faces.event.PhaseId;import org.springframework.util.Assert;/** * A <strong>Phase</strong> is a single step in the processing of a JavaServer * Faces request throughout its entire {@link javax.faces.lifecycle.Lifecycle}. * Each <code>Phase</code> performs the required transitions on the state * information in the {@link FacesContext} associated with this request. * * @author Andreas Kuhrwahl * @see LifecycleImpl#execute(FacesContext) * @see LifecycleImpl#render(FacesContext) */public interface Phase { /** * Static class that converts a {@link PhaseId} into a readable form. The * following table shows the conversions: * * <table class="javaDoc"> * <tr> * <th>PhaseId</th> * <th>human readable string</th> * </tr> * <tr> * <td>{@link PhaseId#RESTORE_VIEW}</td> * <td>RESTORE_VIEW</td> * </tr> * <tr> * <td>{@link PhaseId#APPLY_REQUEST_VALUES}</td> * <td>APPLY_REQUEST_VALUES</td> * </tr> * <tr> * <td>{@link PhaseId#PROCESS_VALIDATIONS}</td> * <td>PROCESS_VALIDATIONS</td> * </tr> * <tr> * <td>{@link PhaseId#UPDATE_MODEL_VALUES}</td> * <td>UPDATE_MODEL_VALUES</td> * </tr> * <tr> * <td>{@link PhaseId#INVOKE_APPLICATION}</td> * <td>INVOKE_APPLICATION</td> * </tr> * <tr> * <td>{@link PhaseId#RENDER_RESPONSE}</td> * <td>RENDER_RESPONSE</td> * </tr> * </table> * <p> * </p> * * @author Andreas Kuhrwahl * @see PhaseId */ public static final class PhaseIdName { /** The string based values of each known {@link PhaseId}. */ private static final String RESTORE_VIEW = "RESTORE_VIEW", APPLY_REQUEST_VALUES = "APPLY_REQUEST_VALUES", PROCESS_VALIDATIONS = "PROCESS_VALIDATIONS", UPDATE_MODEL_VALUES = "UPDATE_MODEL_VALUES", INVOKE_APPLICATION = "INVOKE_APPLICATION", RENDER_RESPONSE = "RENDER_RESPONSE"; /** * Private Constructor - it's a static class. */ private PhaseIdName() { super(); } /** * Converts the given <code>phaseId</code> into a human readable * string. * * @param phaseId * phase identifier * @return the human readable representation of a {@link PhaseId} */ public static String valueOf(final PhaseId phaseId) { Assert.notNull(phaseId); String name = null; if (phaseId.toString().startsWith(RESTORE_VIEW)) { name = RESTORE_VIEW; } else if (phaseId.toString().startsWith(APPLY_REQUEST_VALUES)) { name = APPLY_REQUEST_VALUES; } else if (phaseId.toString().startsWith(PROCESS_VALIDATIONS)) { name = PROCESS_VALIDATIONS; } else if (phaseId.toString().startsWith(UPDATE_MODEL_VALUES)) { name = UPDATE_MODEL_VALUES; } else if (phaseId.toString().startsWith(INVOKE_APPLICATION)) { name = INVOKE_APPLICATION; } else if (phaseId.toString().startsWith(RENDER_RESPONSE)) { name = RENDER_RESPONSE; } return name; } } /** * Perform all state transitions required by the current phase of the * request processing {@link javax.faces.lifecycle.Lifecycle} for a * particular request. * * @param context * FacesContext for the current request being processed * @throws javax.faces.FacesException * if a processing error occurred while executing this phase */ void execute(FacesContext context); /** * Returns the current {@link javax.faces.lifecycle.Lifecycle} <strong>Phase</strong> * identifier. * * @return phase identifier */ PhaseId getId();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -