FileDocCategorySizeDatePackage
ModificationHandler.javaAPI DocJaudiotagger 2.0.44724Wed Mar 30 16:11:52 BST 2011org.jaudiotagger.audio.generic

ModificationHandler

public class ModificationHandler extends Object implements AudioFileModificationListener
This class multicasts the events to multiple listener instances.
Additionally the Vetos are handled. (other listeners are notified).
author
Christian Laireiter

Fields Summary
private Vector
listeners
The listeners to wich events are broadcasted are stored here.
Constructors Summary
Methods Summary
public voidaddAudioFileModificationListener(AudioFileModificationListener l)
This method adds an {@link AudioFileModificationListener}

param
l Listener to add.


                    
       
    
        if (!this.listeners.contains(l))
        {
            this.listeners.add(l);
        }
    
public voidfileModified(org.jaudiotagger.audio.AudioFile original, java.io.File temporary)
(overridden)

see
org.jaudiotagger.audio.generic.AudioFileModificationListener#fileModified(org.jaudiotagger.audio.AudioFile, File)

        for (AudioFileModificationListener listener : this.listeners)
        {
            AudioFileModificationListener current = listener;
            try
            {
                current.fileModified(original, temporary);
            }
            catch (ModifyVetoException e)
            {
                vetoThrown(current, original, e);
                throw e;
            }
        }
    
public voidfileOperationFinished(java.io.File result)
(overridden)

see
org.jaudiotagger.audio.generic.AudioFileModificationListener#fileOperationFinished(File)

        for (AudioFileModificationListener listener : this.listeners)
        {
            AudioFileModificationListener current = listener;
            current.fileOperationFinished(result);
        }
    
public voidfileWillBeModified(org.jaudiotagger.audio.AudioFile file, boolean delete)
(overridden)

see
org.jaudiotagger.audio.generic.AudioFileModificationListener#fileWillBeModified(org.jaudiotagger.audio.AudioFile, boolean)

        for (AudioFileModificationListener listener : this.listeners)
        {
            AudioFileModificationListener current = listener;
            try
            {
                current.fileWillBeModified(file, delete);
            }
            catch (ModifyVetoException e)
            {
                vetoThrown(current, file, e);
                throw e;
            }
        }
    
public voidremoveAudioFileModificationListener(AudioFileModificationListener l)
This method removes an {@link AudioFileModificationListener}

param
l Listener to remove.

        if (this.listeners.contains(l))
        {
            this.listeners.remove(l);
        }
    
public voidvetoThrown(AudioFileModificationListener cause, org.jaudiotagger.audio.AudioFile original, org.jaudiotagger.audio.exceptions.ModifyVetoException veto)
(overridden)

see
org.jaudiotagger.audio.generic.AudioFileModificationListener#vetoThrown(org.jaudiotagger.audio.generic.AudioFileModificationListener, org.jaudiotagger.audio.AudioFile, org.jaudiotagger.audio.exceptions.ModifyVetoException)

        for (AudioFileModificationListener listener : this.listeners)
        {
            AudioFileModificationListener current = listener;
            current.vetoThrown(cause, original, veto);
        }