de.phleisch.app.itsucks.filter.download.impl
Class RegExpJobFilter

java.lang.Object
  extended by de.phleisch.app.itsucks.filter.impl.AbstractJobFilter
      extended by de.phleisch.app.itsucks.filter.download.impl.RegExpJobFilter
All Implemented Interfaces:
JobFilter, java.io.Serializable

public class RegExpJobFilter
extends AbstractJobFilter
implements JobFilter, java.io.Serializable

This filter is very flexible because of it's feature to filter download job attributes by regular expressions.

Author:
olli
See Also:
Serialized Form

Nested Class Summary
static class RegExpJobFilter.RegExpFilterAction
          This class saves the changes which are applied to a filtered job.
static class RegExpJobFilter.RegExpFilterRule
          This is a single regular expression rule.
 
Field Summary
 
Fields inherited from class de.phleisch.app.itsucks.filter.impl.AbstractJobFilter
mContext
 
Constructor Summary
RegExpJobFilter()
           
 
Method Summary
 void addFilterRule(RegExpJobFilter.RegExpFilterRule pRule)
          Adds an filter rule.
 Job filter(Job pJob)
          Filters the job.
 java.util.List<RegExpJobFilter.RegExpFilterRule> getFilterRules()
          Returns a list of all registered filter rules.
 boolean isLetUnfilteredJobsPass()
          Returns if unfiltered jobs (no rule matches) should let passed.
 void removeFilterRule(RegExpJobFilter.RegExpFilterRule pRule)
          Removes an filter rule.
 void setLetUnfilteredJobsPass(boolean pValue)
          Sets if unfiltered jobs (no rule matches) should let passed.
 boolean supports(Job pJob)
          Asks the Filter if it supports the given job.
 
Methods inherited from class de.phleisch.app.itsucks.filter.impl.AbstractJobFilter
getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.phleisch.app.itsucks.filter.JobFilter
setContext
 

Constructor Detail

RegExpJobFilter

public RegExpJobFilter()
Method Detail

filter

public Job filter(Job pJob)
           throws java.lang.Exception
Description copied from interface: JobFilter
Filters the job. At this operation any modification can me made to the job like changing the priority, state, parameter etc.

Specified by:
filter in interface JobFilter
Returns:
Throws:
java.lang.Exception

supports

public boolean supports(Job pJob)
Description copied from interface: JobFilter
Asks the Filter if it supports the given job. This method is called before the filtering starts. It is not allowed to change the job.

Specified by:
supports in interface JobFilter
Returns:

setLetUnfilteredJobsPass

public void setLetUnfilteredJobsPass(boolean pValue)
Sets if unfiltered jobs (no rule matches) should let passed. If set to false jobs which does not matches at least one rule is rejected. Default value is true (let unfiltered jobs pass).

Parameters:
pValue -

isLetUnfilteredJobsPass

public boolean isLetUnfilteredJobsPass()
Returns if unfiltered jobs (no rule matches) should let passed. If set to false jobs which does not matches at least one rule is rejected.

Parameters:
pValue -

addFilterRule

public void addFilterRule(RegExpJobFilter.RegExpFilterRule pRule)
Adds an filter rule.

Parameters:
pRule -

removeFilterRule

public void removeFilterRule(RegExpJobFilter.RegExpFilterRule pRule)
Removes an filter rule.

Parameters:
pRule -

getFilterRules

public java.util.List<RegExpJobFilter.RegExpFilterRule> getFilterRules()
Returns a list of all registered filter rules.

Returns:


Copyright © 2010. All Rights Reserved.