Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.ucsb.ccs.jcontractor
Interface InstrumentationFilter  view InstrumentationFilter download InstrumentationFilter.java

All Known Implementing Classes:
CompositeInstrumentationFilter, PackageLevelInstrumentationFilter, SimpleInstrumentationFilter

public interface InstrumentationFilter

Interface for instrumentation filters, which control the level to which classes are instrumented. The available levels are none, pre, post, and all. An instrumentation filter is used to determine the level of processing given to each class that is instrumented.

Often, several instrumentation filters will be combined, and will need to take precedence over others. For example, if one says that all classes in edu.ucsb.ccs.jcontractor are to be instrumented to the precondition level, and another filter says that edu.ucsb.ccs.jcontractor.jContractor is to be instrumented to the postcondition level, then the second should probably take priority. To faciltate this ordering, each filter has a filter level, which reflects how important it is compared to other filters. Filters with higher filter levels are more important.

There is an implicit ordering of instrumenation levels, and the constants in this class reflect that order. NONE < PRE < POST < ALL.

   None - No contracts checked.
   Pre  - Preconditions checked.
   Post - Preconditions and postconditions checked.
   All  - Preconditions, postconditions, and invariants checked.
 

Version:
$Id: InstrumentationFilter.java,v 1.1 2002/03/28 19:16:30 parkera Exp $

Field Summary
static int ALL
          Instrumentation level for checking all contracts: preconditions, postconditions, and invariants.
static int NONE
          Instrumentation level constant for no instrumentation at all.
static int POST
          Instrumentation level for checking preconditions and postconditions.
static int PRE
          Instrumentation level for checking preconditions only.
 
Method Summary
 boolean appliesTo(java.lang.String classname)
          Determine if this filter applies to a given class.
 int getFilterLevel()
          Get the filter level of this filter.
 int getInstrumentationLevel(java.lang.String classname)
          Get the instrumentation level for a class.
 

Field Detail

NONE

public static final int NONE
Instrumentation level constant for no instrumentation at all. In this level, code is run without any contract checking.

See Also:
Constant Field Values

PRE

public static final int PRE
Instrumentation level for checking preconditions only.

See Also:
Constant Field Values

POST

public static final int POST
Instrumentation level for checking preconditions and postconditions.

See Also:
Constant Field Values

ALL

public static final int ALL
Instrumentation level for checking all contracts: preconditions, postconditions, and invariants.

See Also:
Constant Field Values
Method Detail

getInstrumentationLevel

public int getInstrumentationLevel(java.lang.String classname)
Get the instrumentation level for a class.


appliesTo

public boolean appliesTo(java.lang.String classname)
Determine if this filter applies to a given class.


getFilterLevel

public int getFilterLevel()
Get the filter level of this filter. Filters with high levels override filters with lower levels.