001 /*
002 * Copyright 2003-2004 The Apache Software Foundation
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.apache.commons.events.observable.standard;
017
018 import org.apache.commons.events.observable.ModificationListener;
019
020 /**
021 * A listener for the <code>StandardModificationHandler</code> that is called
022 * when a collection is about to be modified.
023 *
024 * @since Commons Events 1.0
025 * @version $Revision: 155443 $ $Date: 2005-02-26 13:19:51 +0000 (Sat, 26 Feb 2005) $
026 *
027 * @author Stephen Colebourne
028 */
029 public interface StandardPreModificationListener extends ModificationListener {
030
031 /**
032 * A collection modification is occurring.
033 * <p>
034 * To veto the change, throw <code>ModicationVetoedException</code>.
035 * <p>
036 * This method should be processed quickly, as with all event handling.
037 * It should also avoid modifying the event source (the collection).
038 *
039 * @param event the event detail
040 * @throws ModicationVetoedException to veto
041 */
042 public void modificationOccurring(StandardPreModificationEvent event);
043
044 }