Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SEAMFACES-33 Keep the @RestrictAtPhase default Phases DRY
- Loading branch information
Showing
3 changed files
with
72 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
api/src/main/java/org/jboss/seam/faces/view/config/RestrictAtPhaseDefault.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package org.jboss.seam.faces.view.config; | ||
|
||
import org.jboss.seam.faces.event.PhaseIdType; | ||
|
||
/** | ||
* | ||
* @author bleathem | ||
*/ | ||
public class RestrictAtPhaseDefault | ||
{ | ||
public static final PhaseIdType RESTRICT_INITIAL_DEFAULT; | ||
public static final PhaseIdType RESTRICT_POSTBACK_DEFAULT; | ||
|
||
static { | ||
try { | ||
RESTRICT_INITIAL_DEFAULT = (PhaseIdType) RestrictAtPhase.class.getMethod("initial").getDefaultValue(); | ||
RESTRICT_POSTBACK_DEFAULT = (PhaseIdType) RestrictAtPhase.class.getMethod("postback").getDefaultValue(); | ||
} catch (NoSuchMethodException ex) { | ||
throw new IllegalStateException("Error initialising values", ex); | ||
} catch (SecurityException ex) { | ||
throw new IllegalStateException("Error initialising values", ex); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters