Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.struts.config
Class ActionConfigMatcher  view ActionConfigMatcher download ActionConfigMatcher.java

java.lang.Object
  extended byorg.apache.struts.config.ActionConfigMatcher
All Implemented Interfaces:
java.io.Serializable

public class ActionConfigMatcher
extends java.lang.Object
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.

Since:
Struts 1.2

Nested Class Summary
private  class ActionConfigMatcher.Mapping
          Stores a compiled wildcard pattern and the ActionConfig it came from.
 
Field Summary
private  java.util.List compiledPaths
          The compiled paths and their associated ActionConfig's
private static org.apache.commons.logging.Log log
          The logging instance
private static org.apache.struts.util.WildcardHelper wildcard
          Handles all wildcard pattern matching.
 
Constructor Summary
ActionConfigMatcher(ActionConfig[] configs)
          Finds and precompiles the wildcard patterns from the ActionConfig "path" attributes.
 
Method Summary
protected  ActionConfig convertActionConfig(java.lang.String path, ActionConfig orig, java.util.Map vars)
          Clones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings.
protected  java.lang.String convertParam(java.lang.String val, java.util.Map vars)
          Inserts into a value wildcard-matched strings where specified.
 ActionConfig match(java.lang.String path)
          Matches the path against the compiled wildcard patterns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The logging instance


wildcard

private static final org.apache.struts.util.WildcardHelper wildcard
Handles all wildcard pattern matching.


compiledPaths

private java.util.List compiledPaths
The compiled paths and their associated ActionConfig's

Constructor Detail

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.

Method Detail

match

public ActionConfig match(java.lang.String path)
Matches the path against the compiled wildcard patterns.


convertActionConfig

protected ActionConfig convertActionConfig(java.lang.String path,
                                           ActionConfig orig,
                                           java.util.Map vars)
Clones the ActionConfig and its children, replacing various properties with the values of the wildcard-matched strings.


convertParam

protected java.lang.String convertParam(java.lang.String val,
                                        java.util.Map vars)
Inserts into a value wildcard-matched strings where specified.