net.sourceforge.wurfl.core.handlers.classifiers
Class BaseFilter

java.lang.Object
  extended by net.sourceforge.wurfl.core.handlers.classifiers.BaseFilter
All Implemented Interfaces:
Filter

public class BaseFilter
extends Object
implements Filter

Filter base implementation.

The Handler decides if this object can handle the given user-agent. Stores the classified device in held FilteredDevices instance.

Version:
$Id: BaseFilter.java 432 2010-05-06 12:12:53Z filippo.deluca $
Author:
Fantayeneh Asres Gizaw, Filippo De Luca

Constructor Summary
BaseFilter(Handler handler)
          Constructor by Handler and FilteredDevices.
 
Method Summary
 boolean canHandle(String userAgent)
          Use the Handler to know if is possible to handle the user-agent.
 void filter(String userAgent, String deviceID)
          Add the given device id and user-agent to collected devices.
 FilteredDevices getFilteredDevices()
          Return the held FilteredDevices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFilter

public BaseFilter(Handler handler)
Constructor by Handler and FilteredDevices.

Parameters:
handler - The handler used by this object.
Method Detail

canHandle

public boolean canHandle(String userAgent)
Use the Handler to know if is possible to handle the user-agent.

Specified by:
canHandle in interface Filter
Parameters:
userAgent - The user-agent to probr.
Returns:
True if this classifier can handle userAgent.

filter

public void filter(String userAgent,
                   String deviceID)
Add the given device id and user-agent to collected devices.

Specified by:
filter in interface Filter
Parameters:
userAgent - The user-agent to classify.
deviceID - The device identifier corresponding to given user-agent.

getFilteredDevices

public FilteredDevices getFilteredDevices()
Return the held FilteredDevices.

Specified by:
getFilteredDevices in interface Filter


Copyright © 2008-2010 WURFL-Pro srl. All Rights Reserved.