com.opensymphony.xwork2.config.impl
Class ActionConfigMatcher

java.lang.Object
  extended by com.opensymphony.xwork2.config.impl.AbstractMatcher<ActionConfig>
      extended by com.opensymphony.xwork2.config.impl.ActionConfigMatcher
All Implemented Interfaces:
java.io.Serializable

public class ActionConfigMatcher
extends AbstractMatcher<ActionConfig>
implements java.io.Serializable

Matches paths against pre-compiled wildcard expressions pulled from action configs. It uses the wildcard matcher from the Apache Cocoon project. Patterns will be matched in the order they exist in the config file. The first match wins, so more specific patterns should be defined before less specific patterns.

See Also:
Serialized Form

Constructor Summary
ActionConfigMatcher(java.util.Map<java.lang.String,ActionConfig> configs)
          Deprecated. Since 2.1, use ActionConfigMatcher(PatternMatcher, Map, boolean) instead
ActionConfigMatcher(java.util.Map<java.lang.String,ActionConfig> configs, boolean looseMatch)
          Deprecated. Since 2.1, use ActionConfigMatcher(PatternMatcher, Map, boolean) instead
ActionConfigMatcher(PatternMatcher<?> patternMatcher, java.util.Map<java.lang.String,ActionConfig> configs, boolean looseMatch)
           Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes.
 
Method Summary
 ActionConfig convert(java.lang.String path, ActionConfig orig, java.util.Map<java.lang.String,java.lang.String> vars)
           Clones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings.
 
Methods inherited from class com.opensymphony.xwork2.config.impl.AbstractMatcher
addPattern, convertParam, freeze, match, replaceParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionConfigMatcher

@Deprecated
public ActionConfigMatcher(java.util.Map<java.lang.String,ActionConfig> configs)
Deprecated. Since 2.1, use ActionConfigMatcher(PatternMatcher, Map, boolean) instead

Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. ActionConfig's will be evaluated in the order they exist in the config file. Only paths that actually contain a wildcard will be compiled. Patterns will matched strictly.

Parameters:
configs - An array of ActionConfig's to process

ActionConfigMatcher

@Deprecated
public ActionConfigMatcher(java.util.Map<java.lang.String,ActionConfig> configs,
                                      boolean looseMatch)
Deprecated. Since 2.1, use ActionConfigMatcher(PatternMatcher, Map, boolean) instead

Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. ActionConfig's will be evaluated in the order they exist in the config file. Only paths that actually contain a wildcard will be compiled.

Patterns can optionally be matched "loosely". When the end of the pattern matches \*[^*]\*$ (wildcard, no wildcard, wildcard), if the pattern fails, it is also matched as if the last two characters didn't exist. The goal is to support the legacy "*!*" syntax, where the "!*" is optional.

Parameters:
configs - An array of ActionConfig's to process
looseMatch - To loosely match wildcards or not

ActionConfigMatcher

public ActionConfigMatcher(PatternMatcher<?> patternMatcher,
                           java.util.Map<java.lang.String,ActionConfig> configs,
                           boolean looseMatch)

Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes. ActionConfig's will be evaluated in the order they exist in the config file. Only paths that actually contain a wildcard will be compiled.

Patterns can optionally be matched "loosely". When the end of the pattern matches \*[^*]\*$ (wildcard, no wildcard, wildcard), if the pattern fails, it is also matched as if the last two characters didn't exist. The goal is to support the legacy "*!*" syntax, where the "!*" is optional.

Parameters:
configs - An array of ActionConfig's to process
looseMatch - To loosely match wildcards or not
Method Detail

convert

public ActionConfig convert(java.lang.String path,
                            ActionConfig orig,
                            java.util.Map<java.lang.String,java.lang.String> vars)

Clones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings.

Specified by:
convert in class AbstractMatcher<ActionConfig>
Parameters:
path - The requested path
orig - The original ActionConfig
vars - A Map of wildcard-matched strings
Returns:
A cloned ActionConfig with appropriate properties replaced with wildcard-matched values


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.