new EventFilter(type, criteria, priorityopt)
Creates a new filter for an event. The filter is a simple detecter for a single set of criteria, but can be chained
together into a firewall-like set of policies as a EventListener filterList.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | 
            
            "allow" | "deny" | Whether this filter is allowing or denying a specific event.  | 
        ||||||||||||||||||||||||||
criteria | 
            
            object | An Object describing the filter rules Properties
  | 
        ||||||||||||||||||||||||||
priority | 
            
            number | 
                
                    <optional> | 
            
            
                100 | The priority of this specific filter. Not useful for a single filter,
but used as part of an EventListener   | 
        
Properties:
| Name | Type | Description | 
|---|---|---|
allow | 
            
            boolean | 
  | 
        
deny | 
            
            boolean | 
  | 
        
priority | 
            
            number | The relative priority of this filter. Used when part of a EventListener   | 
        
criteria | 
            
            object | The original criteria object passed to the constructor  | 
        
Methods
- 
    
        
static buildTestFn(criteria) → {function}
 - 
    
    
Builds a test function for the specified criteria
Parameters:
Name Type Description criteriaobject The criteria object. See EventFilter constructor for details.
Returns:
function -A function that recieves a single EventBase parameter and returns
trueif the event matches the criteria,falseotherwise - 
    
        
allowEvent(event) → {boolean}
 - 
    
    
Indicates whether this event should be allowed or not
Parameters:
Name Type Description eventboolean The event to evaluate against the criteria
Returns:
boolean -Returns
trueif the event matches the criteria and should be allowed,falseotherwise - 
    
        
denyEvent(event) → {boolean}
 - 
    
    
Indicates whether this event should be denied or not
Parameters:
Name Type Description eventboolean The event to evaluate against the criteria
Returns:
boolean -Returns
trueif the event matches the criteria and should be denied,falseotherwise - 
    
        
matchEvent(event) → {boolean}
 - 
    
    
Indicates whether the event matches the criteria or not
Parameters:
Name Type Description eventEventBase The event to evaluate against the criteria
Returns:
boolean -Returns
trueif the specified event matches the criteria specified in the constructor,falseotherwise