JIVE Platform
Release 0.3.1

edu.buffalo.cse.jive.ui.search.queries
Class ExceptionCaughtSearchQuery

java.lang.Object
  extended by edu.buffalo.cse.jive.ui.search.AbstractJiveSearchQuery
      extended by edu.buffalo.cse.jive.ui.search.ExecutionHistorySearchQuery
          extended by edu.buffalo.cse.jive.ui.search.queries.ExceptionCaughtSearchQuery
All Implemented Interfaces:
SequenceModel.EventVisitor, IJiveSearchQuery, ISearchQuery

public class ExceptionCaughtSearchQuery
extends ExecutionHistorySearchQuery

An IJiveSearchQuery that is used to check whether an exception was caught and, if so, where it was thrown. The query is capable of finding caught exceptions of a particular type or caught by a particular class, instance, or in a certain method.


Nested Class Summary
protected  class ExceptionCaughtSearchQuery.ExceptionEventExporter
          An exporter used to examine ExceptionEvents and to determine if the event is and exception caught by a JiveSearchPattern and exception name.
 
Field Summary
protected  String exceptionName
          The exception name for which to search.
protected  ExceptionCaughtSearchQuery.ExceptionEventExporter exporter
          An exporter used to examine ExceptionEvents.
protected  Map<ThreadID,EventOccurrence> lastStepMap
          A mapping between a thread and the last EOSEvent occurring on it.
protected  JiveSearchPattern pattern
          A search pattern for the catcher of the exception.
 
Constructor Summary
ExceptionCaughtSearchQuery(JiveSearchPattern pattern, String exceptionName)
          Constructs a new search query with the supplied pattern and exception name.
 
Method Summary
protected  boolean checkForMatch(ExceptionEvent event)
          Checks if the supplied ExceptionEvent matches the pattern and exception name.
 ImageDescriptor getImageDescriptor()
          Returns an ImageDescriptor used to represent the search query's result in the Search view's 'Show Previous Searches' tool bar action.
 String getResultLabel(int matchCount)
          Returns a label describing the search result used in the Search view.
 void visit(EventOccurrence event)
          Visits an EventOccurrernce (other than a MessageSend).
 void visit(MessageSend event)
          Visits an occurrence of a MessageSend event.
 
Methods inherited from class edu.buffalo.cse.jive.ui.search.ExecutionHistorySearchQuery
addMatch, getResultType, performSearch
 
Methods inherited from class edu.buffalo.cse.jive.ui.search.AbstractJiveSearchQuery
canRerun, canRunInBackground, createSearchResult, getLabel, getSearchResult, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exporter

protected ExceptionCaughtSearchQuery.ExceptionEventExporter exporter
An exporter used to examine ExceptionEvents.


pattern

protected JiveSearchPattern pattern
A search pattern for the catcher of the exception.


exceptionName

protected String exceptionName
The exception name for which to search.


lastStepMap

protected Map<ThreadID,EventOccurrence> lastStepMap
A mapping between a thread and the last EOSEvent occurring on it.

Constructor Detail

ExceptionCaughtSearchQuery

public ExceptionCaughtSearchQuery(JiveSearchPattern pattern,
                                  String exceptionName)
Constructs a new search query with the supplied pattern and exception name.

Parameters:
pattern - the pattern describing the catcher of the exception
exceptionName - the name of the exception
Method Detail

getResultLabel

public String getResultLabel(int matchCount)
Description copied from interface: IJiveSearchQuery
Returns a label describing the search result used in the Search view. Typically, this describes what is being searched for and the number of matches, as supplied by matchCount.

Parameters:
matchCount - the number of matches thus far
Returns:
a description of what is being searched

getImageDescriptor

public ImageDescriptor getImageDescriptor()
Description copied from interface: IJiveSearchQuery
Returns an ImageDescriptor used to represent the search query's result in the Search view's 'Show Previous Searches' tool bar action.

Returns:
an image descriptor representing the result

visit

public void visit(EventOccurrence event)
Description copied from interface: SequenceModel.EventVisitor
Visits an EventOccurrernce (other than a MessageSend).

Parameters:
event - the event occurrence being visited

visit

public void visit(MessageSend event)
Description copied from interface: SequenceModel.EventVisitor
Visits an occurrence of a MessageSend event.

Parameters:
event - the message send being visited

checkForMatch

protected boolean checkForMatch(ExceptionEvent event)
Checks if the supplied ExceptionEvent matches the pattern and exception name.

Parameters:
event - the exception event to check
Returns:
true if the exception matches the pattern, false otherwise

JIVE Platform
Release 0.3.1