Search in sources :

Example 1 with PathMacros

use of jodd.madvoc.macro.PathMacros in project jodd by oblac.

the class ActionPathMacroInjector method inject.

public void inject(final ActionRequest actionRequest, final Targets targets) {
    final ActionRuntime actionRuntime = actionRequest.getActionRuntime();
    final RouteChunk routeChunk = actionRuntime.getRouteChunk();
    if (!routeChunk.hasMacrosOnPath()) {
        // no action path macros at all, just exit
        return;
    }
    // inject
    final String[] actionPath = actionRequest.getActionPathChunks();
    int ndx = actionPath.length - 1;
    RouteChunk chunk = routeChunk;
    while (chunk.parent() != null) {
        final PathMacros pathMacros = chunk.pathMacros();
        if (pathMacros != null) {
            injectMacros(actionPath[ndx], pathMacros, targets);
        }
        ndx--;
        chunk = chunk.parent();
    }
}
Also used : PathMacros(jodd.madvoc.macro.PathMacros) ActionRuntime(jodd.madvoc.config.ActionRuntime) RouteChunk(jodd.madvoc.config.RouteChunk)

Aggregations

ActionRuntime (jodd.madvoc.config.ActionRuntime)1 RouteChunk (jodd.madvoc.config.RouteChunk)1 PathMacros (jodd.madvoc.macro.PathMacros)1