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 com.opensymphony.xwork2.config.entities.ExceptionMappingConfig;
    21  import org.apache.struts.config.ExceptionConfig;
    22
    23  /***
    24   * Wrapper for a Struts 1.x ExceptionConfig based on an XWork ExceptionMappingConfig.  Using a
    25   * wrapper object allows us to be explicit about what is and isn't implemented.
    26   */
    27  class WrapperExceptionConfig extends ExceptionConfig {
    28
    29      private ExceptionMappingConfig delegate;
    30
    31      public WrapperExceptionConfig(ExceptionMappingConfig delegate) {
    32          this.delegate = delegate;
    33          freeze();
    34      }
    35
    36      public String getBundle() {
    37          throw new UnsupportedOperationException("NYI");
    38      }
    39
    40      public String getHandler() {
    41          throw new UnsupportedOperationException("NYI");
    42      }
    43
    44      public String getKey() {
    45          throw new UnsupportedOperationException("NYI");
    46      }
    47
    48      public String getPath() {
    49          throw new UnsupportedOperationException("NYI");
    50      }
    51
    52      public String getScope() {
    53          throw new UnsupportedOperationException("NYI");
    54      }
    55
    56      public String getType() {
    57          return delegate.getExceptionClassName();
    58      }
    59
    60      public String toString() {
    61          return "wrapper -> " + delegate.toString();
    62      }
    63  }