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.event;
 
 
 import java.util.List;


Typesafe enumeration of the legal values that may be returned by the getPhaseId() method of the FacesEvent interface.

 
 
 public class PhaseId implements Comparable {
 
 
     // ----------------------------------------------------------- Constructors
 

    

Private constructor to disable the creation of new instances.

 
     private PhaseId(String newPhaseName) {
          = newPhaseName;
     }
 
 
     // ----------------------------------------------------- Instance Variables
 

    

The ordinal value assigned to this instance.

 
     private final int ordinal = ++;

    

The (optional) name for this phase.

 
 
     private String phaseName = null;
 
 
     // --------------------------------------------------------- Public Methods
 

    

Compare this PhaseId instance to the specified one. Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

Parameters:
other The other object to be compared to
 
     public int compareTo(Object other) {
 
         return this. - ((PhaseIdother).;
 
     }


    

Return the ordinal value of this PhaseId instance.

    public int getOrdinal() {
        return (this.);
    }


    

Return a String representation of this PhaseId instance.

    public String toString() {
        if (null == ) {
            return (String.valueOf(this.));
        }
        return (String.valueOf(this.) + ' ' + this.);
    }
    // ------------------------------------------------------- Static Variables


    

Static counter returning the ordinal value to be assigned to the next instance that is created.

    private static int nextOrdinal = 0;
    // ------------------------------------------------------ Create Instances
    // Any new Phase values must go at the end of the list, or we will break
    // backwards compatibility on serialized instances
    private static final String ANY_PHASE_NAME = "ANY";
    

Identifier that indicates an interest in events, no matter which request processing phase is being performed.

    public static final PhaseId ANY_PHASE = new PhaseId();
    private static final String RESTORE_VIEW_NAME = "RESTORE_VIEW";
    

Identifier that indicates an interest in events queued for the Restore View phase of the request processing lifecycle.

    public static final PhaseId RESTORE_VIEW = new PhaseId();
    private static final String APPLY_REQUEST_VALUES_NAME = "APPLY_REQUEST_VALUES";
    

Identifier that indicates an interest in events queued for the Apply Request Values phase of the request processing lifecycle.

    public static final PhaseId APPLY_REQUEST_VALUES = new PhaseId();
    private static final String PROCESS_VALIDATIONS_NAME = "PROCESS_VALIDATIONS";
    

Identifier that indicates an interest in events queued for the Process Validations phase of the request processing lifecycle.

    public static final PhaseId PROCESS_VALIDATIONS = new PhaseId();
    private static final String UPDATE_MODEL_VALUES_NAME = "UPDATE_MODEL_VALUES";
    

Identifier that indicates an interest in events queued for the Update Model Values phase of the request processing lifecycle.

    public static final PhaseId UPDATE_MODEL_VALUES = new PhaseId();
    private static final String INVOKE_APPLICATION_NAME = "INVOKE_APPLICATION";
    

Identifier that indicates an interest in events queued for the Invoke Application phase of the request processing lifecycle.

    public static final PhaseId INVOKE_APPLICATION = new PhaseId();
    private static final String RENDER_RESPONSE_NAME = "RENDER_RESPONSE";
    

Identifier for the Render Response phase of the request processing lifecycle.

    public static final PhaseId RENDER_RESPONSE = new PhaseId();


    

Array of all defined values, ascending order of ordinal value. Be sure you include any new instances created above, in the same order.

    private static final PhaseId[] values =
            {,
                    };


    

List of valid PhaseId instances, in ascending order of their ordinal value.

    public static final List<PhaseIdVALUES =
            Collections.unmodifiableList(Arrays.asList());
New to GrepCode? Check out our FAQ X