View Javadoc

1   /*
2    * Copyright 2004 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    * 
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   * $Header:$
17   */
18  package org.apache.struts2.s1;
19  
20  import org.apache.struts.action.ActionForward;
21  import com.opensymphony.xwork2.config.entities.ResultConfig;
22  
23  /***
24   * Wrapper for a Struts 1.x ActionForward based on an XWork ResultConfig.  Using a wrapper object
25   * allows us to be explicit about what is and isn't implemented.
26   */
27  class WrapperActionForward extends ActionForward {
28  
29      private ResultConfig delegate;
30      
31      public WrapperActionForward(ResultConfig delegate) {
32          super(delegate.getName());
33          this.delegate = delegate;
34          freeze();
35      }
36  
37      public String getName() {
38          return delegate.getName();
39      }
40  
41      public String getPath() {
42          throw new UnsupportedOperationException("NYI");
43      }
44  
45      public String getModule() {
46          throw new UnsupportedOperationException("NYI");
47      }
48  
49      public boolean getRedirect() {
50          throw new UnsupportedOperationException("NYI");
51      }
52  
53      public String toString() {
54          return "wrapper -> " + delegate.toString();
55      }
56  }