Coverage Report - org.seasar.teeda.core.exception.ExtendMethodNotFoundExceptin
 
Classes in this File Line Coverage Branch Coverage Complexity
ExtendMethodNotFoundExceptin
94%
15/16
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 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,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.exception;
 17  
 
 18  
 import javax.faces.el.MethodBinding;
 19  
 import javax.faces.el.MethodNotFoundException;
 20  
 
 21  
 import org.seasar.framework.message.MessageFormatter;
 22  
 
 23  
 /**
 24  
  * @author shot
 25  
  */
 26  
 public class ExtendMethodNotFoundExceptin extends MethodNotFoundException {
 27  
 
 28  
     private static final long serialVersionUID = 3257852073575265329L;
 29  
 
 30  
     private static final String METHOD_NOT_FOUND_EXCEPTION_ID = "ETDA0002";
 31  
 
 32  
     private String messageCode_;
 33  
 
 34  
     private Object[] args_;
 35  
 
 36  
     private String simpleMessage_;
 37  
 
 38  
     private String message_;
 39  
 
 40  
     private MethodBinding methodBinding_;
 41  
 
 42  
     public ExtendMethodNotFoundExceptin(MethodNotFoundException cause,
 43  
             MethodBinding mb) {
 44  1
         this(cause, mb.getClass().getName(), mb.getExpressionString());
 45  1
         methodBinding_ = mb;
 46  1
     }
 47  
 
 48  
     public ExtendMethodNotFoundExceptin(Exception cause, String className,
 49  
             String expressionString) {
 50  2
         this(cause, className, expressionString, METHOD_NOT_FOUND_EXCEPTION_ID);
 51  2
     }
 52  
 
 53  
     protected ExtendMethodNotFoundExceptin(Exception cause, String className,
 54  
             String expressionString, String messageCode) {
 55  2
         super(cause);
 56  2
         args_ = new Object[] { className, expressionString };
 57  2
         messageCode_ = messageCode;
 58  2
         simpleMessage_ = MessageFormatter.getSimpleMessage(messageCode_, args_);
 59  2
         message_ = MessageFormatter.getFormattedMessage(messageCode_,
 60  
                 simpleMessage_);
 61  
 
 62  2
     }
 63  
 
 64  
     public MethodBinding getMethodBinding() {
 65  1
         return methodBinding_;
 66  
     }
 67  
 
 68  
     public final String getMessageCode() {
 69  2
         return messageCode_;
 70  
     }
 71  
 
 72  
     public final Object[] getArgs() {
 73  1
         return args_;
 74  
     }
 75  
 
 76  
     public final String getMessage() {
 77  2
         return message_;
 78  
     }
 79  
 
 80  
     public final String getSimpleMessage() {
 81  0
         return simpleMessage_;
 82  
     }
 83  
 
 84  
 }