01: /*
02: * Copyright 2006 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.myfaces.el.unified.resolver.implicitobject;
18:
19: import java.beans.FeatureDescriptor;
20: import javax.el.ELContext;
21: import javax.faces.context.FacesContext;
22:
23: /**
24: * Encapsulates information needed by the ImplicitObjectResolver
25: *
26: * @author Stan Silvert
27: */
28: public class FacesContextImplicitObject extends ImplicitObject {
29:
30: private static final String NAME = "facesContext".intern();
31:
32: /** Creates a new instance of FacesContextImplicitObject */
33: public FacesContextImplicitObject() {
34: }
35:
36: public String getName() {
37: return NAME;
38: }
39:
40: public Object getValue(ELContext context) {
41: return facesContext(context);
42: }
43:
44: public Class getType() {
45: return null;
46: }
47:
48: public FeatureDescriptor getDescriptor() {
49: return makeDescriptor(NAME,
50: "Per-request information for a JSF request",
51: FacesContext.class);
52: }
53:
54: }
|