Package cn.bran.japid.template

Examples of cn.bran.japid.template.RenderResult


    @Override
    protected void doLayout() {
    }
   
    public RenderResult render(String str, Integer i) {
      return new RenderResult();
    }
View Full Code Here


    public Foo2(StringBuilder out) {
      super(out);
    }

    public RenderResult render(List<String> lists) {
      return new RenderResult();
    }
View Full Code Here

    public Bar(StringBuilder out) {
      super(out);
    }
   
    public RenderResult render() {
      return new RenderResult();
    }
View Full Code Here

    try {
      play.classloading.enhancers.ControllersEnhancer.ControllerInstrumentation.initActionCall();
      runPlayAction();
      throw new RuntimeException("No render result from running play action. Probably the action was not using Japid templates.");
    } catch (JapidResult jr) {
      RenderResult rr = jr.getRenderResult();
//      if (shouldCache()) {
////        play.cache.Cache.set(keyString, jr, cacheForVal);
//        System.out.println("put in result cache");
//        RenderResultCache.set(keyString, rr, cacheForVal);
//      }
View Full Code Here

   * @param args
   *            arguments
   */
  public static <T extends JapidTemplateBase> void render(Class<T> c, Object... args) {
    try {
      RenderResult rr = invokeRender(c, args);
      throw new JapidResult(rr);
    } catch (Exception e) {
      if (e instanceof JapidResult)
        throw (JapidResult) e;
      // e.printStackTrace();
View Full Code Here

    try {
      // String methodName = "render";
      Constructor<T> ctor = c.getConstructor(StringBuilder.class);
      StringBuilder sb = new StringBuilder(8000);
      T t = ctor.newInstance(sb);
      RenderResult rr = (RenderResult) RenderInvokerUtils.render(t, args);
      // RenderResult rr = (RenderResult) MethodUtils.invokeMethod(t,
      // methodName, args);
      return rr;
    } catch (NoSuchMethodException e) {
      throw new RuntimeException("Could not match the arguments with the template args.");
View Full Code Here

      String templateFileName = templateClassName.replace(DOT, '/') + HTML;
      throw new RuntimeException("Could not find a Japid template with the name of: " + templateFileName);
    } else {
      Class tClass = appClass.javaClass;
      if (JapidTemplateBase.class.isAssignableFrom(tClass)) {
        RenderResult rr;
        // render(tClass, args);
        rr = invokeRender(tClass, args);
        return (rr);
      } else {
        throw new RuntimeException("The found class is not a Japid template class: " + templateClassName);
View Full Code Here

      // assuming second
      ttl += "s";
    }

    String base = StackTraceUtils.getCaller();
    RenderResult rr = getFromCache(base, objects);
    if (rr == null) {
      rr = runner.run();
      cache(rr, ttl, base, objects);
    }
    // System.out.println("render show took ms: " + rr.getRenderTime());
View Full Code Here

   * downstream of the pipeline
   *
   * @param r
   */
  protected static void render(CacheableRunner r) {
    RenderResult rr = r.run();
    throw new JapidResult(rr);
  }
View Full Code Here

   * @param s
   */
  protected static void renderText(String s) {
    Map<String, String> headers = new HashMap<String, String>();
    headers.put("Content-Type", "text/plain; charset=utf-8");
    render(new RenderResult(headers, new StringBuilder(s), -1L));
  }
View Full Code Here

TOP

Related Classes of cn.bran.japid.template.RenderResult

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.