com.atlassian.plugin.servlet.util
Class DefaultPathMapper

java.lang.Object
  extended by com.atlassian.plugin.servlet.util.DefaultPathMapper
All Implemented Interfaces:
PathMapper, java.io.Serializable

public class DefaultPathMapper
extends java.lang.Object
implements java.io.Serializable, PathMapper

Originally opied from Atlassian Seraph 1.0

Modified to store a list of keys for a mapping rather than a single value. This allows filters to be added that listen on the same path. The get() method will return the first value added if there are multiple keys matching the path, while the getAll() method returns the aggregate matches.

In practice, matching a servlet path should use the get() method and matching filters should use the getAll() method.

Since:
2.1.0
See Also:
Serialized Form

Constructor Summary
DefaultPathMapper()
           
 
Method Summary
 java.lang.String get(java.lang.String path)
          Retrieve appropriate key by matching patterns with supplied path.
 java.util.Collection<java.lang.String> getAll(java.lang.String path)
          Retrieve all mappings which match a supplied path.
 void put(java.lang.String key, java.lang.String pattern)
          Add a key and appropriate matching pattern.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultPathMapper

public DefaultPathMapper()
Method Detail

put

public void put(java.lang.String key,
                java.lang.String pattern)
Description copied from interface: PathMapper
Add a key and appropriate matching pattern.

Specified by:
put in interface PathMapper

get

public java.lang.String get(java.lang.String path)
Description copied from interface: PathMapper
Retrieve appropriate key by matching patterns with supplied path.

Specified by:
get in interface PathMapper

getAll

public java.util.Collection<java.lang.String> getAll(java.lang.String path)
Description copied from interface: PathMapper
Retrieve all mappings which match a supplied path.

Specified by:
getAll in interface PathMapper

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.