public class Event
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Event |
END_BATCH_EVENT
Deprecated.
Use
createEndBatchEvent() instead of this global object. |
static Event |
NOOP_EVENT
Deprecated.
Use
createNoopEvent() instead of this global object. |
static Event |
START_BATCH_EVENT
Deprecated.
Use
createStartBatchEvent() instead of this global object. |
static Event |
START_BATCH_ITEM_EVENT
Deprecated.
Never used in Okapi, so we will not create a helper method. But using it is dangerous.
|
Constructor and Description |
---|
Event() |
Event(EventType filterEventType)
Creates a new event without any associated resource.
|
Event(EventType filterEventType,
IResource resource)
Creates a new event with an associated resource.
|
Event(EventType filterEventType,
IResource resource,
ISkeleton skeleton)
Creates a new event with an associated resource and a skeleton object.
|
Modifier and Type | Method and Description |
---|---|
static Event |
createEndBatchEvent()
Convenience method that creates an
EventType.END_BATCH event |
static Event |
createNoopEvent()
Convenience method that creates an
EventType.NO_OP event |
static Event |
createStartBatchEvent()
Convenience method that creates an
EventType.START_BATCH event |
DocumentPart |
getDocumentPart()
Convenience method returns the
IResource as a DocumentPart . |
Ending |
getEndGroup()
|
Ending |
getEnding()
Convenience method returns the Ending resource.
|
EndSubfilter |
getEndSubfilter()
Convenience method returns the
IResource as a EndSubfilter . |
EventType |
getEventType()
Gets the type of this event.
|
MultiEvent |
getMultiEvent()
Convenience method returns the
IResource as a MultiEvent . |
PipelineParameters |
getPipelineParameters()
Convenience method returns the
IResource as a PipelineParameters . |
RawDocument |
getRawDocument()
Convenience method returns the
IResource as a RawDocument . |
IResource |
getResource()
Gets the resource associated to this event.
|
StartDocument |
getStartDocument()
Convenience method returns the
IResource as a StartDocument . |
StartGroup |
getStartGroup()
Convenience method returns the
IResource as a StartGroup . |
StartSubDocument |
getStartSubDocument()
Convenience method returns the
IResource as a StartSubDocument . |
StartSubfilter |
getStartSubfilter()
Convenience method returns the
IResource as a StartSubfilter . |
ITextUnit |
getTextUnit()
|
boolean |
isDocumentPart()
Convenience method to tell if this Event carries a
DocumentPart |
boolean |
isEndDocument()
Convenience method to tell if this Event carries a document
Ending |
boolean |
isEndGroup()
Convenience method to tell if this Event carries a group
Ending |
boolean |
isEndSubDocument()
Convenience method to tell if this Event carries a sub-document
Ending |
boolean |
isEndSubfilter()
Convenience method to tell if this Event is a SubFilter Group
|
boolean |
isMultiEvent()
Convenience method to tell if this Event is a MULTI_EVENT
|
boolean |
isNoop() |
boolean |
isPipelineParametersEvent()
Indicates if this event carries a
PipelineParameters resource. |
boolean |
isRawDocument()
Convenience method to tell if this Event carries a
RawDocument |
boolean |
isStartBatchItem()
Convenience method to tell if this Event is START_BATCH_ITEM
|
boolean |
isStartDocument()
Convenience method to tell if this Event carries a
StartDocument |
boolean |
isStartGroup()
Convenience method to tell if this Event carries a
StartGroup |
boolean |
isStartSubDocument()
Convenience method to tell if this Event carries a
StartSubDocument |
boolean |
isStartSubfilter()
Convenience method to tell if this Event is a SubFilter Group
|
boolean |
isTextUnit()
Convenience method to tell if this Event carries a
ITextUnit |
void |
setEventType(EventType filterEventType) |
void |
setResource(IResource resource)
Sets the resource associated to this event.
|
java.lang.String |
toString() |
@Deprecated public static final Event END_BATCH_EVENT
createEndBatchEvent()
instead of this global object.@Deprecated public static final Event NOOP_EVENT
createNoopEvent()
instead of this global object.@Deprecated public static final Event START_BATCH_EVENT
createStartBatchEvent()
instead of this global object.@Deprecated public static final Event START_BATCH_ITEM_EVENT
public Event()
public Event(EventType filterEventType)
filterEventType
- the type of event to create.public Event(EventType filterEventType, IResource resource)
filterEventType
- the type of event to create.resource
- the resource to associate to the event.public Event(EventType filterEventType, IResource resource, ISkeleton skeleton)
filterEventType
- the type of event to create.resource
- the resource to associate to the event.skeleton
- the skeleton to associate to the event.public EventType getEventType()
public IResource getResource()
public void setResource(IResource resource)
resource
- the new resource.public void setEventType(EventType filterEventType)
public boolean isTextUnit()
ITextUnit
ITextUnit
, false otherwisepublic boolean isDocumentPart()
DocumentPart
DocumentPart
, false otherwisepublic boolean isStartGroup()
StartGroup
StartGroup
, false otherwisepublic boolean isEndGroup()
Ending
Ending
, false otherwisepublic boolean isRawDocument()
RawDocument
RawDocument
, false otherwisepublic boolean isStartDocument()
StartDocument
StartDocument
, false otherwisepublic boolean isEndDocument()
Ending
Ending
, false otherwisepublic boolean isStartBatchItem()
public boolean isStartSubDocument()
StartSubDocument
StartSubDocument
, false otherwisepublic boolean isEndSubDocument()
Ending
Ending
, false otherwisepublic boolean isMultiEvent()
MultiEvent
, false otherwisepublic boolean isStartSubfilter()
StartSubfilter
, false otherwisepublic boolean isEndSubfilter()
StartSubfilter
, false otherwisepublic ITextUnit getTextUnit()
IResource
as a ITextUnit
.
The caller should confirm the Event
type using isTextUnit before
calling this method.ITextUnit
OkapiUnexpectedResourceTypeException
- if the IResource
is not a ITextUnit
public DocumentPart getDocumentPart()
IResource
as a DocumentPart
.
The caller should confirm the Event
type using isDocumentPart before calling
this method.DocumentPart
OkapiUnexpectedResourceTypeException
- if the IResource
is not a DocumentPart
public StartGroup getStartGroup()
IResource
as a StartGroup
. The
caller should confirm the Event
type using isStartGroup before calling this
method.StartGroup
OkapiUnexpectedResourceTypeException
- if the IResource
is not a StartGroup
public Ending getEndGroup()
IResource
as a Ending
. The caller
should confirm the Event
type using isEndGroup before calling this method.Ending
OkapiUnexpectedResourceTypeException
- if the IResource
is not a Ending
public Ending getEnding()
public RawDocument getRawDocument()
IResource
as a RawDocument
. The
caller should confirm the Event
type using isRawDocument before calling
this method.RawDocument
OkapiUnexpectedResourceTypeException
- if the IResource
is not a RawDocument
public StartSubDocument getStartSubDocument()
IResource
as a StartSubDocument
. The
caller should confirm the Event
type using isStartSubDocument before calling
this method.StartSubDocument
OkapiUnexpectedResourceTypeException
- if the IResource
is not a StartSubDocument
public StartDocument getStartDocument()
IResource
as a StartDocument
. The
caller should confirm the Event
type using isStartDocument before calling
this method.StartDocument
OkapiUnexpectedResourceTypeException
- if the IResource
is not a StartDocument
public StartSubfilter getStartSubfilter()
IResource
as a StartSubfilter
. The
caller should confirm the Event
type using isStartSubfilter before calling
this method.StartSubfilter
OkapiUnexpectedResourceTypeException
- if the IResource
is not a StartSubfilter
public EndSubfilter getEndSubfilter()
IResource
as a EndSubfilter
. The
caller should confirm the Event
type using isEndSubfilter before calling
this method.EndSubfilter
OkapiUnexpectedResourceTypeException
- if the IResource
is not a EndSubfilter
public MultiEvent getMultiEvent()
IResource
as a MultiEvent
. The
caller should confirm the EventType
using isMultiEvent before calling
this method.MultiEvent
OkapiUnexpectedResourceTypeException
- if the IResource
is not a MultiEvent
public boolean isPipelineParametersEvent()
PipelineParameters
resource.PipelineParameters
resource, false otherwise.public PipelineParameters getPipelineParameters()
IResource
as a PipelineParameters
.PipelineParameters
OkapiUnexpectedResourceTypeException
- if the IResource
is not a PipelineParameters
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isNoop()
public static final Event createEndBatchEvent()
EventType.END_BATCH
eventpublic static final Event createNoopEvent()
EventType.NO_OP
eventpublic static final Event createStartBatchEvent()
EventType.START_BATCH
eventCopyright © 2022. All rights reserved.