org.jlab.coda.jevio
Class EventParser

java.lang.Object
  extended by org.jlab.coda.jevio.EventParser

public class EventParser
extends java.lang.Object

Creates an object that controls the parsing of events. This object, like the EvioReader object, has a method for parsing an event. An EvioReader object will ultimately call this method--i.e., the concrete implementation of event parsing is in this class.

Author:
heddle, timmer

Constructor Summary
EventParser()
           
 
Method Summary
 void addEvioListener(IEvioListener listener)
          Add an Evio listener.
 boolean isNotificationActive()
          Get the flag determining whether notification of listeners is active.
 void parseEvent(EvioEvent evioEvent)
          This is the workhorse method for parsing the event.
 void removeEvioListener(IEvioListener listener)
          Remove an Evio listener.
 void setEvioFilter(IEvioFilter evioFilter)
          Set the global filter used for filtering structures.
 void setNotificationActive(boolean notificationActive)
          Set the flag determining whether notification of listeners is active.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventParser

public EventParser()
Method Detail

parseEvent

public void parseEvent(EvioEvent evioEvent)
                throws EvioException
This is the workhorse method for parsing the event. It will drill down and uncover all structures (banks, segments, and tagsegments) and notify any interested listeners in a SAX-Like manner.
Note: applications may choose not to provide a listener. In that case, when the event is parsed, its structures may be accessed through the event's tree model, i.e., via event.getTreeModel().

Parameters:
evioEvent - the event to parse.
Throws:
EvioException

removeEvioListener

public void removeEvioListener(IEvioListener listener)
Remove an Evio listener. Evio listeners listen for structures encountered when an event is being parsed.

Parameters:
listener - The Evio listener to remove.

addEvioListener

public void addEvioListener(IEvioListener listener)
Add an Evio listener. Evio listeners listen for structures encountered when an event is being parsed.

Parameters:
listener - The Evio listener to add.

isNotificationActive

public boolean isNotificationActive()
Get the flag determining whether notification of listeners is active. Normally it is. But in some cases it should be temporarily suspended. For example, in a "goto event" process, the listeners will not be notified of the intervening events as the file is scanned to get to the target event.

Returns:
true if notification of events to the listeners is active.

setNotificationActive

public void setNotificationActive(boolean notificationActive)
Set the flag determining whether notification of listeners is active. Normally it is. But in some cases it should be temporarily suspended. For example, in a "goto event" process, the listeners will not be notified of the intervening events as the file is scanned to get to the target event.

Parameters:
notificationActive - set true if notification of events to the listeners is active.

setEvioFilter

public void setEvioFilter(IEvioFilter evioFilter)
Set the global filter used for filtering structures. If set to null, the default, then all structures will be sent to the listeners.

Parameters:
evioFilter - the filter to set.
See Also:
IEvioFilter