Coverage Report - org.apache.commons.events.observable.ModificationVetoedException
 
Classes in this File Line Coverage Branch Coverage Complexity
ModificationVetoedException
0%
0/4
0%
0/2
1
 
 1  
 /*
 2  
  * Copyright 2003-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  
 package org.apache.commons.events.observable;
 17  
 
 18  
 /**
 19  
  * Exception thrown when a modification to a collection is vetoed.
 20  
  * It extends IllegalArgumentException for compatibility with the collections API.
 21  
  *
 22  
  * @since Commons Events 1.0
 23  
  * @version $Revision: 155443 $ $Date: 2005-02-26 13:19:51 +0000 (Sat, 26 Feb 2005) $
 24  
  * 
 25  
  * @author Stephen Colebourne
 26  
  */
 27  
 public class ModificationVetoedException extends IllegalArgumentException {
 28  
 
 29  
     /** The source event */
 30  
     protected final ModificationEvent event;
 31  
 
 32  
     // Constructor
 33  
     //-----------------------------------------------------------------------
 34  
     /**
 35  
      * Constructor.
 36  
      * 
 37  
      * @param message  the text message, may be null
 38  
      * @param event  the observed event, should not be null
 39  
      */
 40  
     public ModificationVetoedException(final String message, final ModificationEvent event) {
 41  0
         super((message == null ? "Modification vetoed" : message));
 42  0
         this.event = event;
 43  0
     }
 44  
 
 45  
     // Event access
 46  
     //-----------------------------------------------------------------------
 47  
     /**
 48  
      * Gets the event that caused the veto.
 49  
      * 
 50  
      * @return the event
 51  
      */
 52  
     public ModificationEvent getEvent() {
 53  0
         return event;
 54  
     }
 55  
 
 56  
 }