Package httl

Examples of httl.Context


  public Object get(String key) {
    if ("parent".equals(key)) {
      return Context.getContext().getParent();
    } else if ("super".equals(key)) {
      Context parent = Context.getContext().getParent();
      return parent == null ? null : parent.getTemplate();
    } else if ("this".equals(key)) {
      return Context.getContext().getTemplate();
    } else if ("engine".equals(key)) {
      return Context.getContext().getEngine();
    } else if ("out".equals(key)) {
View Full Code Here


  }

  public void render(Object parameters, Object out) throws IOException, ParseException {
    Map<String, Object> map = convertMap(parameters);
    out = convertOut(out);
    Context context = Context.pushContext(map);
    try {
      context.setTemplate(this);
      if (out instanceof OutputStream) {
        context.setOut((OutputStream) out);
      } else if (out instanceof Writer) {
        context.setOut((Writer) out);
      } else {
        throw new IllegalArgumentException("No such Converter to convert the " + out.getClass().getName() + " to OutputStream or Writer.");
      }
      if (interceptor != null) {
        interceptor.render(context, new Listener() {
View Full Code Here

TOP

Related Classes of httl.Context

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.