Package com.google.clearsilver.jsilver

Examples of com.google.clearsilver.jsilver.JSilver


      System.out.println("Usage: JSilverTest file.cs [file.hdf file2.hdf ...]");
      System.exit(1);
    }

    // Load resources from filesystem, relative to the current directory.
    JSilver jSilver = new JSilver(new FileSystemResourceLoader("."));

    // Load data.
    Data data = jSilver.createData();
    for (int i = 1; i < args.length; i++) {
      jSilver.loadData(args[i], data);
    }

    // Render template to System.out.
    jSilver.render(args[0], data, System.out);
  }
View Full Code Here


public class Iterate {

  public static void main(String[] args) throws IOException {

    // Load resources (e.g. templates) from classpath, along side this class.
    JSilver jSilver = new JSilver(new ClassResourceLoader(Iterate.class));

    // Set up some data.
    Data data = jSilver.createData();
    data.setValue("query", "Fruit");
    data.setValue("results.0.title", "Banana");
    data.setValue("results.0.url", "http://banana.com/");
    data.setValue("results.1.title", "Apple");
    data.setValue("results.1.url", "http://apple.com/");
    data.setValue("results.2.title", "Lemon");
    data.setValue("results.2.url", "http://lemon.com/");

    // Render template to System.out.
    jSilver.render("iterate.cs", data, System.out);
  }
View Full Code Here

public class HelloWorld {

  public static void main(String[] args) throws IOException {

    // Load resources (e.g. templates) from classpath, along side this class.
    JSilver jSilver = new JSilver(new ClassResourceLoader(HelloWorld.class));

    // Set up some data.
    Data data = jSilver.createData();
    data.setValue("name.first", "Mr");
    data.setValue("name.last", "Man");

    // Render template to System.out.
    jSilver.render("hello-world.cs", data, System.out);
  }
View Full Code Here

  public JSilverFactory(JSilverOptions options) {
    this(options, true);
  }

  public JSilverFactory(JSilverOptions options, boolean unwrapDelegatedHdfs) {
    this(new JSilver(null, options), unwrapDelegatedHdfs);
  }
View Full Code Here

TOP

Related Classes of com.google.clearsilver.jsilver.JSilver

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.