net.sourceforge.wurfl.core.request
Class UserAgentNormalizerChain

java.lang.Object
  extended by net.sourceforge.wurfl.core.request.UserAgentNormalizerChain
All Implemented Interfaces:
UserAgentNormalizer

public class UserAgentNormalizerChain
extends Object
implements UserAgentNormalizer

Chain of UserAgentNormalizers.

Apply the normalizers as filters, to the target user-agent. All the normalizer are applied, it is not a chain of responsibility.

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

Constructor Summary
UserAgentNormalizerChain()
          Default constructor.
UserAgentNormalizerChain(List normalizers)
          Constructor by list of UserAgentNormalizer.
UserAgentNormalizerChain(UserAgentNormalizer[] normalizers)
          Constructor by UserAgentNormalizer array.
 
Method Summary
 void add(UserAgentNormalizer userAgentNormalizer)
          Add a UserAgentNormalizer to the chain.
 List getAllNormalizers()
          Return all UserAgentNormalizers managed by this chain.
 String normalize(String userAgent)
          Return normalized user-agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAgentNormalizerChain

public UserAgentNormalizerChain()
Default constructor.


UserAgentNormalizerChain

public UserAgentNormalizerChain(List normalizers)
Constructor by list of UserAgentNormalizer.

Parameters:
normalizers - The List used to implement the chain.

UserAgentNormalizerChain

public UserAgentNormalizerChain(UserAgentNormalizer[] normalizers)
Constructor by UserAgentNormalizer array.

Parameters:
normalizers - The UserAgentNormalizer array used to implement the chain.
Method Detail

add

public void add(UserAgentNormalizer userAgentNormalizer)
Add a UserAgentNormalizer to the chain.

Parameters:
userAgentNormalizer - The UserAgentNormalizer to add.

normalize

public String normalize(String userAgent)
Return normalized user-agent. Applies all UserAgentNormalizer to the target user-agent.

Specified by:
normalize in interface UserAgentNormalizer
Parameters:
userAgent - String contains user-agent to normalize.
Returns:
String contains normalized user-agent.

getAllNormalizers

public List getAllNormalizers()
Return all UserAgentNormalizers managed by this chain.

Returns:
List contains all UserAgentNormalizer used by this chain.


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