class Preselector extends Scoper {
    @SuppressWarnings("unused")
    private static final long serialVersionUID = 3L;

    {
        setRecheckScope(false);
    }
    public boolean getRecheckScope() {
        return (Boolean) kp.get("recheckScope");
    }
    /**
     * Recheck if uri is in scope. This is meaningful if the scope is altered
     * during a crawl. URIs are checked against the scope when they are added to
     * queues. Setting this value to true forces the URI to be checked against
     * the scope when it is coming out of the queue, possibly after the scope
     * is altered.
     */
    public void setRecheckScope(boolean recheck) {
        kp.put("recheckScope",recheck);
    }

    {
        setBlockAll(false);
    }
    public boolean getBlockAll() {
        return (Boolean) kp.get("blockAll");
    }
    /**
     * Block all URIs from being processed. This is most likely to be used in
     * overrides to easily reject certain hosts from being processed.
     */
    public void setBlockAll(boolean recheck) {
        kp.put("blockAll",recheck);
    }

    {
        setBlockByRegex("");
    }
    public String getBlockByRegex() {
        return (String) kp.get("blockByRegex");
    }
    /**
     * Block all URIs matching the regular expression from being processed.
     */
    public void setBlockByRegex(String regex) {
        kp.put("blockByRegex",regex);
    }

    {
        setAllowByRegex("");
    }
    public String getAllowByRegex() {
        return (String) kp.get("allowByRegex");
    }
    /**
     * Allow only URIs matching the regular expression to be processed.
     */
    public void setAllowByRegex(String regex) {
        kp.put("allowByRegex",regex);
    }
    
    /**
     * Constructor.
     */
    public Preselector() {
        super();
    }

    @Override
    protected boolean shouldProcess(CrawlURI puri) {
        return puri instanceof CrawlURI;
    }

    
    @Override
    protected void innerProcess(CrawlURI puri) {
        throw new AssertionError();
    }
    

    @Override
    protected ProcessResult innerProcessResult(CrawlURI puri) {<FILL_FUNCTION_BODY>}
}

        CrawlURI curi = (CrawlURI)puri;
        
        // Check if uris should be blocked
        if (getBlockAll()) {
            curi.setFetchStatus(S_BLOCKED_BY_USER);
            return ProcessResult.FINISH;
        }

        // Check if allowed by regular expression
        String regex = getAllowByRegex();
        if (regex != null && !regex.equals("")) {
            if (!TextUtils.matches(regex, curi.toString())) {
                curi.setFetchStatus(S_BLOCKED_BY_USER);
                return ProcessResult.FINISH;
            }
        }

        // Check if blocked by regular expression
        regex = getBlockByRegex();
        if (regex != null && !regex.equals("")) {
            if (TextUtils.matches(regex, curi.toString())) {
                curi.setFetchStatus(S_BLOCKED_BY_USER);
                return ProcessResult.FINISH;
            }
        }

        // Possibly recheck scope
        if (getRecheckScope()) {
            if (!isInScope(curi)) {
                // Scope rejected
                curi.setFetchStatus(S_OUT_OF_SCOPE);
                return ProcessResult.FINISH;
            }
        }
        
        return ProcessResult.PROCEED;
    
<methods>public void <init>() ,public boolean getLogToFile() ,public org.archive.crawler.reporting.CrawlerLoggerModule getLoggerModule() ,public org.archive.modules.deciderules.DecideRule getScope() ,public boolean isRunning() ,public void setLogToFile(boolean) ,public void setLoggerModule(org.archive.crawler.reporting.CrawlerLoggerModule) ,public void setScope(org.archive.modules.deciderules.DecideRule) ,public void start() ,public void stop() <variables>protected java.util.logging.Logger fileLogger,protected boolean isRunning,protected org.archive.crawler.reporting.CrawlerLoggerModule loggerModule,protected org.archive.modules.deciderules.DecideRule scope