public class EventParser
extends java.lang.Object
There is also a static method to do the parsing of an event, but without notifications.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
notificationActive
This flag determines whether notification of listeners is active.
|
| Constructor and Description |
|---|
EventParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEvioListener(IEvioListener listener)
Add an Evio listener.
|
(package private) static BankHeader |
createBankHeader(byte[] bytes,
int offset,
java.nio.ByteOrder byteOrder)
Create a bank header from the first eight bytes of the data array.
|
(package private) static SegmentHeader |
createSegmentHeader(byte[] bytes,
int offset,
java.nio.ByteOrder byteOrder)
Create a segment header from the first four bytes of the data array.
|
(package private) static TagSegmentHeader |
createTagSegmentHeader(byte[] bytes,
int offset,
java.nio.ByteOrder byteOrder)
Create a tag segment header from the first four bytes of the data array.
|
static void |
eventParse(EvioEvent evioEvent)
Method for parsing the event which will drill down and uncover all structures.
|
boolean |
isNotificationActive()
Get the flag determining whether notification of listeners is active.
|
protected void |
notifyEvioListeners(EvioEvent evioEvent,
IEvioStructure structure)
This is when a structure is encountered while parsing an event.
|
protected void |
notifyStart(EvioEvent evioEvent)
Notify listeners we are starting to parse a new event
|
protected void |
notifyStop(EvioEvent evioEvent)
Notify listeners we are done to parsing a new event
|
void |
parseEvent(EvioEvent evioEvent)
This is the workhorse method for parsing the event.
|
void |
parseEvent(EvioEvent evioEvent,
boolean synced)
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.
|
protected boolean notificationActive
public static void eventParse(EvioEvent evioEvent) throws EvioException
evioEvent - the event to parse.EvioException - if arg is null.public void parseEvent(EvioEvent evioEvent) throws EvioException
event.getTreeModel().evioEvent - the event to parse.EvioException - if arg is null or data not in evio format.public void parseEvent(EvioEvent evioEvent, boolean synced) throws EvioException
event.getTreeModel().evioEvent - the event to parse.synced - if true, synchronize this method.EvioException - if arg is null or data not in evio format.static BankHeader createBankHeader(byte[] bytes, int offset, java.nio.ByteOrder byteOrder) throws EvioException
bytes - the byte array, probably from a bank that encloses this new bank.offset - the offset to start reading from the byte array.byteOrder - byte order of array, ByteOrder.BIG_ENDIAN or ByteOrder.LITTLE_ENDIANEvioException - if data not in evio format.static SegmentHeader createSegmentHeader(byte[] bytes, int offset, java.nio.ByteOrder byteOrder) throws EvioException
bytes - the byte array, probably from a bank that encloses this new segment.offset - the offset to start reading from the byte array.byteOrder - byte order of array, ByteOrder.BIG_ENDIAN or ByteOrder.LITTLE_ENDIANEvioException - if data not in evio format.static TagSegmentHeader createTagSegmentHeader(byte[] bytes, int offset, java.nio.ByteOrder byteOrder) throws EvioException
bytes - the byte array, probably from a bank that encloses this new tag segment.offset - the offset to start reading from the byte array.byteOrder - byte order of array, ByteOrder.BIG_ENDIAN or ByteOrder.LITTLE_ENDIANEvioException - if data not in evio format.protected void notifyEvioListeners(EvioEvent evioEvent, IEvioStructure structure)
evioEvent - event being parsedstructure - the structure encountered, which may be a Bank, Segment, or TagSegment.protected void notifyStart(EvioEvent evioEvent)
evioEvent - the event in question;protected void notifyStop(EvioEvent evioEvent)
evioEvent - the event in question;public void removeEvioListener(IEvioListener listener)
listener - The Evio listener to remove.public void addEvioListener(IEvioListener listener)
listener - The Evio listener to add.public boolean isNotificationActive()
true if notification of events to the listeners is active.public void setNotificationActive(boolean notificationActive)
notificationActive - set true if notification of events to the listeners is active.public void setEvioFilter(IEvioFilter evioFilter)
null, the default, then all
structures will be sent to the listeners.evioFilter - the filter to set.IEvioFilter