org.abstracthorizon.danube.http.matcher
Class Pattern

java.lang.Object
  extended by org.abstracthorizon.danube.http.matcher.AbstractMatcher
      extended by org.abstracthorizon.danube.http.matcher.Pattern
All Implemented Interfaces:
Matcher

public class Pattern
extends AbstractMatcher

Implementation of Matcher interface that uses Pattern for matching.

Author:
Daniel Sendula

Field Summary
protected  String componentPath
          Component path to be set when pattern is matched
protected  boolean matchAsComponentPath
          Matches as component's path
protected  Pattern pattern
          Precompiled pattern
 
Fields inherited from class org.abstracthorizon.danube.http.matcher.AbstractMatcher
connectionHandler, stopOnMatch
 
Constructor Summary
Pattern()
          Constructor
 
Method Summary
 void adjustForInvocation(HTTPConnection httpConnection)
          Adjusts connection for nested connection handler to be invoked
 Pattern getCompiledPattern()
          Returns precompiled pattern
 String getComponentPath()
          Returns component path
 String getPattern()
          Returns pattern as a String
 boolean isMatchAsComponentPath()
           
 boolean matches(HTTPConnection httpConnection)
          Uses precompiled pattern to match URI from http conneciton
 void setCompiledPattern(Pattern pattern)
          Sets precompiled pattern
 void setComponentPath(String componentPath)
          Sets component path.
 void setMatchAsComponentPath(boolean matchAsComponentPath)
           
 void setPattern(String pattern)
          Sets pattern as a String
 
Methods inherited from class org.abstracthorizon.danube.http.matcher.AbstractMatcher
getConnectionHandler, isStopOnMatch, setConnectionHandler, setStopOnMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

protected Pattern pattern
Precompiled pattern


componentPath

protected String componentPath
Component path to be set when pattern is matched


matchAsComponentPath

protected boolean matchAsComponentPath
Matches as component's path

Constructor Detail

Pattern

public Pattern()
Constructor

Method Detail

getCompiledPattern

public Pattern getCompiledPattern()
Returns precompiled pattern

Returns:
precompiled pattern

setCompiledPattern

public void setCompiledPattern(Pattern pattern)
Sets precompiled pattern

Parameters:
pattern - precompiled pattern

getPattern

public String getPattern()
Returns pattern as a String

Returns:
pattern as a String

setPattern

public void setPattern(String pattern)
Sets pattern as a String

Parameters:
pattern - pattern as a String

getComponentPath

public String getComponentPath()
Returns component path

Returns:
component path

setComponentPath

public void setComponentPath(String componentPath)
Sets component path. If component path doesn't start with an "/" it is automatically added. TODO Should leading / be stripped at the same time?

Parameters:
componentPath - component path

matches

public boolean matches(HTTPConnection httpConnection)
Uses precompiled pattern to match URI from http conneciton

Parameters:
httpConnection - http connection
Returns:
true if uri from connection is matched

adjustForInvocation

public void adjustForInvocation(HTTPConnection httpConnection)
Adjusts connection for nested connection handler to be invoked

Parameters:
connection - connection to be a used

isMatchAsComponentPath

public boolean isMatchAsComponentPath()

setMatchAsComponentPath

public void setMatchAsComponentPath(boolean matchAsComponentPath)


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.