Package org.apache.abdera.i18n.templates

Examples of org.apache.abdera.i18n.templates.Route


 
  public String urlFor(
    RequestContext context,
    Object key,
    Object param) {
    Route route = routes.get(key);
    if (route != null) {
      Map<String, Object> map = new HashMap<String,Object>();
      Context ctx = getContext(param);
      for (String var : ctx) {
        map.put(var, ctx.resolve(var));
      }
      for (String var : route.getVariables()) {
        Object value = context.getTarget().getParameter(var);
        if (!map.containsKey(var) && value != null) {
          map.put(var, value);
        }
      }
      return context.getTargetBasePath() + route.expand(getContext(map));
    } else {
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.i18n.templates.Route

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.