org.apache.struts.config
Class ActionConfigMatcher
java.lang.Object
org.apache.struts.config.ActionConfigMatcher
- Serializable
public class ActionConfigMatcher
extends java.lang.Object
implements Serializable
Matches paths against pre-compiled wildcard expressions pulled from
action configs. It uses the wildcard matcher from the Apache
Cocoon project.
private List | compiledPaths - The compiled paths and their associated ActionConfig's
|
private static Log | log - The logging instance
|
private static WildcardHelper | wildcard - Handles all wildcard pattern matching.
|
protected ActionConfig | convertActionConfig(String path, ActionConfig orig, Map vars) - Clones the ActionConfig and its children, replacing various properties
with the values of the wildcard-matched strings.
|
protected String | convertParam(String val, Map vars) - Inserts into a value wildcard-matched strings where specified.
|
ActionConfig | match(String path) - Matches the path against the compiled wildcard patterns.
|
compiledPaths
private List compiledPaths
The compiled paths and their associated ActionConfig's
log
private static final Log log
The logging instance
wildcard
private static final WildcardHelper wildcard
Handles all wildcard pattern matching.
ActionConfigMatcher
public ActionConfigMatcher(ActionConfig[] configs)
Finds and precompiles the wildcard patterns from the ActionConfig
"path" attributes.
ActionConfig's will be evaluated in the order they exist in the
Struts config file. Only paths that actually contain a wildcard
will be compiled.
configs
- An array of ActionConfig's to process
convertActionConfig
protected ActionConfig convertActionConfig(String path,
ActionConfig orig,
Map vars)
Clones the ActionConfig and its children, replacing various properties
with the values of the wildcard-matched strings.
path
- The requested pathorig
- The original ActionConfigvars
- A Map of wildcard-matched strings
- A cloned ActionConfig with appropriate properties replaced
with wildcard-matched values
convertParam
protected String convertParam(String val,
Map vars)
Inserts into a value wildcard-matched strings where specified.
val
- The value to convertvars
- A Map of wildcard-matched strings
match
public ActionConfig match(String path)
Matches the path against the compiled wildcard patterns.
path
- The portion of the request URI for selecting a config.
- The action config if matched, else null
Copyright B) 2000-2007 - The Apache Software Foundation