Coverage Report - org.seasar.teeda.core.exception.ExtendFacesException
 
Classes in this File Line Coverage Branch Coverage Complexity
ExtendFacesException
84%
16/19
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.FacesException;
 19  
 
 20  
 import org.seasar.framework.message.MessageFormatter;
 21  
 
 22  
 /**
 23  
  * @author shot
 24  
  */
 25  
 public class ExtendFacesException extends FacesException {
 26  
 
 27  
     private static final long serialVersionUID = 3257003246236087604L;
 28  
 
 29  
     private static final String DEFAULT_FACES_EXCEPTION_ID = "ETDA0001";
 30  
 
 31  
     private String messageCode_;
 32  
 
 33  
     private Object[] args_;
 34  
 
 35  
     private String simpleMessage_;
 36  
 
 37  
     private String message_;
 38  
 
 39  
     public ExtendFacesException() {
 40  1
         this(DEFAULT_FACES_EXCEPTION_ID, null, null);
 41  1
     }
 42  
 
 43  
     public ExtendFacesException(String messageCode) {
 44  3
         this(messageCode, null, null);
 45  3
     }
 46  
 
 47  
     public ExtendFacesException(String messageCode, Object[] args) {
 48  11
         this(messageCode, args, null);
 49  11
     }
 50  
 
 51  
     public ExtendFacesException(String messageCode, Object[] args,
 52  
             Throwable cause) {
 53  17
         super(cause);
 54  17
         messageCode_ = messageCode;
 55  17
         args_ = args;
 56  17
         simpleMessage_ = MessageFormatter.getSimpleMessage(messageCode_, args_);
 57  17
         message_ = MessageFormatter.getFormattedMessage(messageCode_,
 58  
                 simpleMessage_);
 59  17
     }
 60  
 
 61  
     public final String getMessageCode() {
 62  2
         return messageCode_;
 63  
     }
 64  
 
 65  
     public final Object[] getArgs() {
 66  3
         return args_;
 67  
     }
 68  
 
 69  
     public final String getMessage() {
 70  2
         return message_;
 71  
     }
 72  
 
 73  
     protected void setMessage(String message) {
 74  0
         message_ = message;
 75  0
     }
 76  
 
 77  
     public final String getSimpleMessage() {
 78  1
         return simpleMessage_;
 79  
     }
 80  
 
 81  
     public Throwable getCause() {
 82  0
         return super.getCause();
 83  
     }
 84  
 
 85  
 }