Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seamfaces 147 - viewActions #64

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed unneeded files and corrected ViewActionUtils
gonzalad committed Nov 2, 2011
commit aacce800241f556cec22580bf884aa9df82b72bf
21 changes: 0 additions & 21 deletions api/src/main/java/org/jboss/seam/faces/view/action/Condition.java

This file was deleted.

22 changes: 0 additions & 22 deletions api/src/main/java/org/jboss/seam/faces/view/action/Immediate.java

This file was deleted.

22 changes: 0 additions & 22 deletions api/src/main/java/org/jboss/seam/faces/view/action/OnPostback.java

This file was deleted.

23 changes: 0 additions & 23 deletions api/src/main/java/org/jboss/seam/faces/view/action/Phase.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -19,11 +19,12 @@ public class ViewActionUtils {
private ViewActionUtils() {
}

public static PhaseInstant getPhaseInstantOrDefault(List<Annotation> annotations, Object parentElement, PhaseInstant defaultInstant) {
public static PhaseInstant getPhaseInstantOrDefault(List<Annotation> annotations, Object parentElement,
PhaseInstant defaultInstant) {
PhaseInstant phaseInstant = getPhaseInstant(annotations, parentElement);
return phaseInstant!=null ? phaseInstant : defaultInstant;
return phaseInstant != null ? phaseInstant : defaultInstant;
}

public static PhaseInstant getPhaseInstant(List<Annotation> annotations, Object parentElement) {
Boolean before = null;
PhaseId phaseId = null;
@@ -44,55 +45,55 @@ public static PhaseInstant getPhaseInstant(List<Annotation> annotations, Object
} else if (annotationType == ApplyRequestValues.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
phaseId = PhaseId.APPLY_REQUEST_VALUES;
} else if (annotationType == ProcessValidations.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
phaseId = PhaseId.PROCESS_VALIDATIONS;
} else if (annotationType == UpdateModelValues.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
phaseId = PhaseId.UPDATE_MODEL_VALUES;
} else if (annotationType == InvokeApplication.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
phaseId = PhaseId.INVOKE_APPLICATION;
} else if (annotationType == RenderResponse.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
phaseId = PhaseId.RENDER_RESPONSE;
} else if (annotationType == BeforeRenderReponse.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
if (before != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples @Before/@After and " + annotationType);
}
phaseId = PhaseId.RENDER_RESPONSE;
before = true;
} else if (annotationType == AfterRenderView.class) {
} else if (annotationType == AfterRenderResponse.class) {
if (phaseId != null) {
throw new IllegalStateException("invalid " + parentElement
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations (" + annotationType
+ " and " + phaseId + ")");
+ ". Cannot be annotated simultaneously with multiples JSF lifecycle annotations ("
+ annotationType + " and " + phaseId + ")");
}
if (before != null) {
throw new IllegalStateException("invalid " + parentElement
@@ -102,13 +103,13 @@ public static PhaseInstant getPhaseInstant(List<Annotation> annotations, Object
before = false;
}
}
if (before==null && phaseId==null) {
if (before == null && phaseId == null) {
return null;
} else if (before!=null && phaseId!=null) {
} else if (before != null && phaseId != null) {
return new PhaseInstant(phaseId, before);
} else {
throw new IllegalStateException("invalid " + parentElement
+ ". both phaseId and @Before/@After must be specified {phaseId: " + phaseId+", before: "+before+"}");
+ ". both phaseId and @Before/@After must be specified {phaseId: " + phaseId + ", before: " + before + "}");
}
}
}