|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.wurfl.core.handlers.matchers.AbstractMatcher
public abstract class AbstractMatcher
Abstract implementation of Matcher.
It provides basic functionalities of matching. The matching strategy is:
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
detected
Log detected |
protected org.apache.commons.logging.Log |
logger
Log |
protected org.apache.commons.logging.Log |
undetected
Log undetected |
| Constructor Summary | |
|---|---|
AbstractMatcher(Handler handler)
Build AbstractMatcher by handler and collected devices by user-agent. |
|
| Method Summary | |
|---|---|
protected String |
applyCatchAllRecoveryMatch(WURFLRequest request,
FilteredDevices filteredDevices)
Match the given request using the CatchAll strategy. |
protected String |
applyConclusiveMatch(WURFLRequest request,
FilteredDevices filteredDevices)
Apply conclusive matching strategy, at least returns generic. |
protected String |
applyRecoveryMatch(WURFLRequest request,
FilteredDevices filteredDevices)
Match the given request using the recovery matching strategy. |
boolean |
canHandle(WURFLRequest request)
Return if this matcher can handle given request. |
protected String |
lookForMatchingUserAgent(SortedSet userAgentsSet,
String userAgent)
Match the given user-agent to collected user-agents. |
String |
match(WURFLRequest request,
FilteredDevices filteredDevices)
Applies the matching strategy. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
protected final org.apache.commons.logging.Log undetected
protected final org.apache.commons.logging.Log detected
| Constructor Detail |
|---|
public AbstractMatcher(Handler handler)
handler - The handler used to decide if this class can handle the
request.| Method Detail |
|---|
public boolean canHandle(WURFLRequest request)
Matcher
canHandle in interface Matcherrequest - The WURFLRequest to check if can be handled.
public final String match(WURFLRequest request,
FilteredDevices filteredDevices)
The strategy is:
match in interface Matcherrequest - The request to match.
protected String applyConclusiveMatch(WURFLRequest request,
FilteredDevices filteredDevices)
generic.
request - The request used to applying matching strategy.
protected String lookForMatchingUserAgent(SortedSet userAgentsSet,
String userAgent)
Apply RIS(FS) to default.
userAgentsSet - A SortedSet of String containing user-agent string naturally
ordered.userAgent - The user-agent to match against.
protected String applyRecoveryMatch(WURFLRequest request,
FilteredDevices filteredDevices)
request - The request to match.
generic.
protected String applyCatchAllRecoveryMatch(WURFLRequest request,
FilteredDevices filteredDevices)
Match the given request using the CatchAll strategy. The subclass can override this method, but must returns "generic" device al least.
TODO this method assumes the wurfl.xml + patch files contains the hard coded device's ids.
request - The request to match.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||