View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.trinidad.component;
20  
21  import java.util.Iterator;
22  import java.util.List;
23  import java.util.Map;
24  import java.util.Set;
25  
26  import javax.el.ValueExpression;
27  
28  import javax.faces.component.behavior.ClientBehavior;
29  import javax.faces.context.FacesContext;
30  import javax.faces.el.ValueBinding;
31  
32  import org.apache.myfaces.trinidad.bean.FacesBean;
33  import org.apache.myfaces.trinidad.bean.PropertyKey;
34  
35  
36  /**
37   * Wrapper for {@link org.apache.myfaces.trinidad.bean.FacesBean}
38   */
39  public class FacesBeanWrapper
40    implements FacesBean
41  {
42    private FacesBean _wrapped;
43  
44    protected FacesBeanWrapper(FacesBean beanToWrap)
45    {
46      _wrapped = beanToWrap;
47    }
48  
49    public FacesBean getWrappedBean()
50    {
51      return _wrapped;
52    }
53  
54    public FacesBean.Type getType()
55    {
56      return _wrapped.getType();
57    }
58  
59    public Object getProperty(PropertyKey key)
60    {
61      return _wrapped.getProperty(key);
62    }
63  
64    public void setProperty(PropertyKey key, Object value)
65    {
66      _wrapped.setProperty(key, value);
67    }
68  
69    public Object getLocalProperty(PropertyKey key)
70    {
71      return _wrapped.getLocalProperty(key);
72    }
73  
74    public ValueExpression getValueExpression(PropertyKey key)
75    {
76      return _wrapped.getValueExpression(key);
77    }
78  
79    @SuppressWarnings("deprecation")
80    public ValueBinding getValueBinding(PropertyKey key)
81    {
82      return _wrapped.getValueBinding(key);
83    }
84  
85    public Object getRawProperty(PropertyKey key)
86    {
87      return _wrapped.getRawProperty(key);
88    }
89  
90    public void setValueExpression(PropertyKey key,
91                                   ValueExpression expression)
92    {
93      _wrapped.setValueExpression(key, expression);
94    }
95  
96    @SuppressWarnings("deprecation")
97    public void setValueBinding(PropertyKey key, ValueBinding binding)
98    {
99      _wrapped.setValueBinding(key, binding);
100   }
101   
102   public void addEntry(PropertyKey listKey, Object value)
103   {
104     _wrapped.addEntry(listKey, value);
105   }
106 
107   public void removeEntry(PropertyKey listKey, Object value)
108   {
109     _wrapped.removeEntry(listKey, value);
110   }
111 
112   public Object[] getEntries(PropertyKey listKey, Class<?> clazz)
113   {
114     return _wrapped.getEntries(listKey, clazz);
115   }
116 
117   public boolean containsEntry(PropertyKey listKey, Class<?> clazz)
118   {
119     return _wrapped.containsEntry(listKey, clazz);
120   }
121 
122   public Iterator<? extends Object> entries(PropertyKey listKey)
123   {
124     return _wrapped.entries(listKey);
125   }
126 
127   public void addAll(FacesBean from)
128   {
129     _wrapped.addAll(from);
130   }
131 
132   public Set<PropertyKey> keySet()
133   {
134     return _wrapped.keySet();
135   }
136 
137   public Set<PropertyKey> bindingKeySet()
138   {
139     return _wrapped.bindingKeySet();
140   }
141 
142   public Object saveState(FacesContext context)
143   {
144     return _wrapped.saveState(context);
145   }
146 
147   public void restoreState(FacesContext context, Object state)
148   {
149     _wrapped.restoreState(context, state);
150   }
151 
152   public void clearInitialState()
153   {
154     _wrapped.clearInitialState();
155   }
156 
157   public void markInitialState()
158   {
159     _wrapped.markInitialState();
160   }
161 
162   public boolean initialStateMarked()
163   {
164     return _wrapped.initialStateMarked();
165   }
166 }