de.dante.extex.scanner.stream.observer.file
Class OpenFileObserverList

java.lang.Object
  extended byde.dante.extex.scanner.stream.observer.file.OpenFileObserverList
All Implemented Interfaces:
OpenFileObserver

public final class OpenFileObserverList
extends java.lang.Object
implements OpenFileObserver

This class provides a type-safe list of observers for the open file event.

Version:
$Revision: 1.4 $
Author:
Gerd Neugebauer

Constructor Summary
OpenFileObserverList()
           
 
Method Summary
 void add(OpenFileObserver observer)
          Add an observer to the list.
static OpenFileObserver register(OpenFileObserver list, OpenFileObserver observer)
          Take a list and add an observer.
 void update(java.lang.String filename, java.lang.String filetype, java.io.InputStream stream)
          Invoke all observers on the list to inform them of the file which has been opened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenFileObserverList

public OpenFileObserverList()
Method Detail

register

public static OpenFileObserver register(OpenFileObserver list,
                                        OpenFileObserver observer)
Take a list and add an observer. If the list is null then a new one is created.

Parameters:
list - the input list or null
observer - the observer to add
Returns:
the input list or a new one with the observer added

add

public void add(OpenFileObserver observer)
Add an observer to the list.

Parameters:
observer - the observer to add to the list

update

public void update(java.lang.String filename,
                   java.lang.String filetype,
                   java.io.InputStream stream)
Invoke all observers on the list to inform them of the file which has been opened.

Specified by:
update in interface OpenFileObserver
Parameters:
filename - the name of the file to be opened
filetype - the type of the file to be opened. The type is resolved via the configuration to a file name pattern
stream - the input stream to read from
See Also:
OpenFileObserver.update( java.lang.String, java.lang.String, java.io.InputStream)