org.openxri.urimapper.impl
Class RegexURIMapper

java.lang.Object
  extended by org.openxri.config.impl.AbstractComponent
      extended by org.openxri.urimapper.impl.RegexURIMapper
All Implemented Interfaces:
java.io.Serializable, Component, URIMapper
Direct Known Subclasses:
FolderURIMapper, SingleNamespaceURIMapper

public abstract class RegexURIMapper
extends AbstractComponent
implements URIMapper

This abstract class can parse an URI using regular expressions for the root namespace (e.g. @free) and the query (*earth*moon). Subclasses need to provide those regular expressions in the constructor and implement the completeURI method of the URIMapper interface.

Author:
=peacekeeper
See Also:
Serialized Form

Field Summary
protected  java.util.regex.Pattern namespacePattern
           
protected  java.util.regex.Pattern queryPattern
           
 
Fields inherited from class org.openxri.config.impl.AbstractComponent
properties
 
Constructor Summary
protected RegexURIMapper(java.util.Properties properties, java.util.regex.Pattern namespacePattern, java.util.regex.Pattern queryPattern)
           
 
Method Summary
 java.util.regex.Pattern getNamespacePattern()
           
 java.util.regex.Pattern getQueryPattern()
           
 URIMapperResult parseRequest(URIMapperRequest request)
          Parses an incoming request (containing of path and query part of a URI)
 void setNamespacePattern(java.util.regex.Pattern nsPattern)
           
 void setQueryPattern(java.util.regex.Pattern queryPattern)
           
 
Methods inherited from class org.openxri.config.impl.AbstractComponent
getProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openxri.urimapper.URIMapper
completeURI
 
Methods inherited from interface org.openxri.config.Component
getProperties, init
 

Field Detail

namespacePattern

protected java.util.regex.Pattern namespacePattern

queryPattern

protected java.util.regex.Pattern queryPattern
Constructor Detail

RegexURIMapper

protected RegexURIMapper(java.util.Properties properties,
                         java.util.regex.Pattern namespacePattern,
                         java.util.regex.Pattern queryPattern)
Method Detail

parseRequest

public URIMapperResult parseRequest(URIMapperRequest request)
Description copied from interface: URIMapper
Parses an incoming request (containing of path and query part of a URI)

Specified by:
parseRequest in interface URIMapper
Parameters:
request - The path and query of the HTTP request.

getNamespacePattern

public java.util.regex.Pattern getNamespacePattern()

setNamespacePattern

public void setNamespacePattern(java.util.regex.Pattern nsPattern)

getQueryPattern

public java.util.regex.Pattern getQueryPattern()

setQueryPattern

public void setQueryPattern(java.util.regex.Pattern queryPattern)


Copyright © 2005-2012. All Rights Reserved.