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.commons.resourcehandler;
20  
21  import javax.el.ValueExpression;
22  import javax.faces.FacesWrapper;
23  
24  import org.apache.myfaces.commons.resourcehandler.resource.ResourceMeta;
25  
26  /**
27   * This class extends from ExtendedResourceMeta to allow cache request path expressions on
28   * the resource cache and reuse it across requests.
29   * 
30   * @author Leonardo Uribe
31   *
32   */
33  public class ExtendedResourceMetaImpl extends ExtendedResourceMeta implements FacesWrapper<ResourceMeta>
34  {
35      private ResourceMeta _delegate;
36      private ValueExpression _requestPath;
37  
38      public ExtendedResourceMetaImpl(ResourceMeta delegate)
39      {
40          _delegate = delegate;
41      }
42  
43      public ValueExpression getRequestPathExpression()
44      {
45          return _requestPath;
46      }
47      
48      public void setRequestPathExpression(ValueExpression expression)
49      {
50          _requestPath = expression;
51      }
52  
53      @Override
54      public String getLibraryName()
55      {
56          return getWrapped().getLibraryName();
57      }
58  
59      @Override
60      public String getResourceName()
61      {
62          return getWrapped().getResourceName();
63      }
64  
65      @Override
66      public String getLocalePrefix()
67      {
68          return getWrapped().getLocalePrefix();
69      }
70  
71      @Override
72      public String getLibraryVersion()
73      {
74          return getWrapped().getLibraryVersion();
75      }
76  
77      @Override
78      public String getResourceVersion()
79      {
80          return getWrapped().getResourceVersion();
81      }
82  
83      @Override
84      public String getResourceIdentifier()
85      {
86          return getWrapped().getResourceIdentifier();
87      }
88  
89      @Override
90      public boolean couldResourceContainValueExpressions()
91      {
92          return getWrapped().couldResourceContainValueExpressions();
93      }
94  
95      public ResourceMeta getWrapped()
96      {
97          return _delegate;
98      }
99  }