Created
September 20, 2013 16:51
-
-
Save lincolnthree/6640477 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @Override | |
| public ProjectStage getProjectStage() | |
| { | |
| if (getFaceted().hasFacet(ServletFacet_2_5.class)) | |
| { | |
| ServletFacet_2_5 facet = getFaceted().getFacet(ServletFacet_2_5.class); | |
| WebAppDescriptor config = facet.getConfig(); | |
| List<ParamValueType<WebAppDescriptor>> params = config.getAllContextParam(); | |
| for (ParamValueType<WebAppDescriptor> param : params) | |
| { | |
| if ("javax.faces.PROJECT_STAGE".equals(param.getParamName())) | |
| { | |
| return ProjectStage.valueOf(ProjectStage.class, param.getParamValue()); | |
| } | |
| } | |
| } | |
| else if (getFaceted().hasFacet(ServletFacet_3_0.class)) | |
| { | |
| ServletFacet_3_0 facet = getFaceted().getFacet(ServletFacet_3_0.class); | |
| org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor config = facet.getConfig(); | |
| List<org.jboss.shrinkwrap.descriptor.api.javaee6.ParamValueType<org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor>> params = config | |
| .getAllContextParam(); | |
| for (org.jboss.shrinkwrap.descriptor.api.javaee6.ParamValueType<org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor> param : params) | |
| { | |
| if ("javax.faces.PROJECT_STAGE".equals(param.getParamName())) | |
| { | |
| return ProjectStage.valueOf(ProjectStage.class, param.getParamValue()); | |
| } | |
| } | |
| } | |
| return ProjectStage.Production; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment