public class RouteMadvocConfigurator extends ManualMadvocConfigurator
MadvocConfigurator that reads
routes defined in external file madvoc-routes.txt
(name can be changed in @link MadvocConfig).
These are the routes rules:
\, it continues to the next line.#, it's a comment and it is ignored.@ and it contains a = sign,
it's a variable definition.
Variables are processed as they appear in the file.[]. Default area defines section
with the same wrappers./. Action path is first such path
and result path is last such path.
async are defined in words that starts with a #.className#methodName..class. If class is
a result class, it will be either registered or set as actions result (if path already defined).
If class is a wrapper, it overrides default wrappers.ManualMadvocConfigurator.ActionBuilder| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Class<? extends ActionWrapper>[] |
currentWrappers |
protected java.lang.String[] |
IGNORED_FIXES |
protected java.util.HashMap<java.lang.String,java.lang.String> |
variables |
actionMethodParser, actionsManager, filtersManager, interceptorsManager, madvocConfig, resultsManager| Constructor and Description |
|---|
RouteMadvocConfigurator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure()
Reads Madvoc route configuration file and process it.
|
protected void |
initDefaultWrappers()
Initializes default wrappers by storing theirs classes.
|
protected void |
parse(java.lang.String routes)
Parses routes file.
|
protected void |
parseLine(java.lang.String line)
Parses single route line.
|
protected void |
processDefaults(java.lang.String line)
Parses the line and sets the current defaults.
|
protected java.lang.String |
replaceVariables(java.lang.String line)
Replaces variables in the line.
|
protected java.lang.String |
trimPrefixAndSuffix(java.lang.String chunk)
Removes common prefixes and suffixes.
|
action, filter, interceptor, resultprotected java.util.HashMap<java.lang.String,java.lang.String> variables
protected java.lang.Class<? extends ActionWrapper>[] currentWrappers
protected java.lang.String[] IGNORED_FIXES
public void configure()
protected void parse(java.lang.String routes)
throws java.lang.Exception
\, it will be joined to the previous line.java.lang.Exceptionprotected void initDefaultWrappers()
protected void parseLine(java.lang.String line)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String trimPrefixAndSuffix(java.lang.String chunk)
protected void processDefaults(java.lang.String line)
protected java.lang.String replaceVariables(java.lang.String line)
Copyright © 2003-2013 Jodd Team