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:
22: /**
23: * Encapsulates information needed by the ImplicitObjectResolver
24: *
25: * @author Stan Silvert
26: */
27: public class ApplicationImplicitObject extends ImplicitObject {
28:
29: private static final String NAME = "application".intern();
30:
31: /** Creates a new instance of ApplicationImplicitObject */
32: public ApplicationImplicitObject() {
33: }
34:
35: public Object getValue(ELContext context) {
36: return externalContext(context).getContext();
37: }
38:
39: public String getName() {
40: return NAME;
41: }
42:
43: public Class getType() {
44: return null;
45: }
46:
47: public FeatureDescriptor getDescriptor() {
48: return makeDescriptor(NAME,
49: "Represents the application environment", Object.class);
50: }
51:
52: }
|