Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

com.cosylab.logging.engine.Filter Class Reference

List of all members.

Public Types

enum  Constraint {
  MINIMUM, MAXIMUM, MINMAX, EXACT,
  STRING_WILDCHAR
}

Public Member Functions

 Filter (LogField field, boolean isLethal, Comparable minimum, Comparable maximum, boolean notFilter) throws InvalidFilterConstraintException
 Filter (LogField field, boolean isLethal, Integer exact, boolean notFilter) throws InvalidFilterConstraintException
 Filter (LogField field, boolean isLethal, Integer minimum, Integer maximum, boolean notFilter) throws InvalidFilterConstraintException
 Filter (LogField field, boolean isLethal, Object exact, boolean notFilter) throws InvalidFilterConstraintException
 Filter (LogField field, boolean isLethal, String regularExpression, boolean notFilter) throws InvalidFilterConstraintException, PatternSyntaxException
 Filter (LogField field, boolean isLethal, String minimum, String maximum, boolean notFilter) throws InvalidFilterConstraintException
 Filter (LogField field, boolean isLethal, Date minimum, Date maximum, boolean notFilter) throws InvalidFilterConstraintException
boolean applyTo (ILogEntry logEntry, boolean lethalCircumstances)
boolean applyTo (Object obj)
String toString ()
String toXMLString ()
boolean notPolicyApplyed ()
boolean getIsLethal ()
LogField getField ()

Static Public Member Functions

static Filter buildFilter (LogField field, String lethal, String not, String min, String minType, String max, String maxType, String exact, String exactType, String wildChar) throws Exception

Public Attributes

LogField field = null
Constraint constraint = null
String regularExpression = null
Comparable minimum = null
Comparable maximum = null
Object exact = null

Detailed Description

A Filter is a class used for filtering LogEntries. It has the following characteristics:


Member Enumeration Documentation

The possible comparison types

Author:
acaproni
Enumerator:
MINIMUM 
MAXIMUM 
MINMAX 
EXACT 
STRING_WILDCHAR 

Constructor & Destructor Documentation

com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
Comparable  minimum,
Comparable  maximum,
boolean  notFilter 
) throws InvalidFilterConstraintException
com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
Integer  exact,
boolean  notFilter 
) throws InvalidFilterConstraintException
com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
Integer  minimum,
Integer  maximum,
boolean  notFilter 
) throws InvalidFilterConstraintException

Insert the method's description here. Creation date: (2/7/02 2:46:21 PM)

Parameters:
field int
isLethal boolean
minimum java.lang.Integer
maximum java.lang.Integer

References com.cosylab.logging.engine.Filter.constraint, com.cosylab.logging.engine.Filter.field, com.cosylab.logging.engine.Filter.maximum, and com.cosylab.logging.engine.Filter.minimum.

com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
Object  exact,
boolean  notFilter 
) throws InvalidFilterConstraintException
com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
String  regularExpression,
boolean  notFilter 
) throws InvalidFilterConstraintException, PatternSyntaxException

Build a filter with a regular expression Check if the string is a valid regular expression

References com.cosylab.logging.engine.Filter.field, and com.cosylab.logging.engine.Filter.regularExpression.

com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
String  minimum,
String  maximum,
boolean  notFilter 
) throws InvalidFilterConstraintException

Insert the method's description here. Creation date: (2/7/02 2:48:18 PM)

Parameters:
field int
isLethal boolean
minimum java.lang.String
maximum java.lang.String

References com.cosylab.logging.engine.Filter.constraint, com.cosylab.logging.engine.Filter.field, com.cosylab.logging.engine.Filter.maximum, and com.cosylab.logging.engine.Filter.minimum.

com.cosylab.logging.engine.Filter.Filter ( LogField  field,
boolean  isLethal,
Date  minimum,
Date  maximum,
boolean  notFilter 
) throws InvalidFilterConstraintException

Insert the method's description here. Creation date: (2/7/02 2:47:35 PM)

Parameters:
field int
isLethal boolean
minimum java.util.Date
maximum java.util.Date

References com.cosylab.logging.engine.Filter.constraint, com.cosylab.logging.engine.Filter.field, com.cosylab.logging.engine.Filter.maximum, and com.cosylab.logging.engine.Filter.minimum.


Member Function Documentation

boolean com.cosylab.logging.engine.Filter.applyTo ( ILogEntry  logEntry,
boolean  lethalCircumstances 
)

The most imporant method of this class. Returns true if LogEntryXML passes through the filter and false otherwise.

If this instance is a non-lethal filter and is called in lethal circumstances (at an engine level), this filter always returns true.

If this instance is a lethal filter and is called in non-lethal circumstances (at a GUI level), this filter always returns true.

References com.cosylab.logging.engine.Filter.field, and com.cosylab.logging.engine.log.ILogEntry.getField().

Referenced by alma.acs.logging.table.LogTableRowFilter.include().

boolean com.cosylab.logging.engine.Filter.applyTo ( Object  obj  ) 
static Filter com.cosylab.logging.engine.Filter.buildFilter ( LogField  field,
String  lethal,
String  not,
String  min,
String  minType,
String  max,
String  maxType,
String  exact,
String  exactType,
String  wildChar 
) throws Exception [static]

Build a Filter object All the parameters are String objects. Before building the object, the value of each parameter is checked This method is too long (and boring) for my taste but it is very easy

Parameters:
field The filed parameter fo Filter
lethal The isLethal parameter of Filter
not The applyAsNOT parameter of Filter
min The minimum parameter of Filter
minType The type of minimum
max The max parameter of Filter
maxType The type of max
exact The exact parameter of Filter
exactType The type of exact
wildChar The regularExpression parameter of Filter
Returns:
The Filter object built or null if an error occurred decoding the parameters
Exceptions:
Exception in case of error building the filter

References com.cosylab.logging.engine.Filter.exact, and com.cosylab.logging.engine.Filter.field.

LogField com.cosylab.logging.engine.Filter.getField (  ) 

Return the type of the filter

Returns:
The type of the filter

References com.cosylab.logging.engine.Filter.field.

boolean com.cosylab.logging.engine.Filter.getIsLethal (  ) 
Returns:
The value of IsLethal
boolean com.cosylab.logging.engine.Filter.notPolicyApplyed (  ) 

Return the NOT policy

Returns:
True if the filter is used with not policy (i.e. The log entries that pass are those who do NOT satify the constraints)

Referenced by com.cosylab.logging.settings.FilterTypePanel.setFilter(), and com.cosylab.logging.settings.FilterIntegerPanel.setFilter().

String com.cosylab.logging.engine.Filter.toString (  ) 
String com.cosylab.logging.engine.Filter.toXMLString (  ) 

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties