Package net.sf.lapg.templates.api

Examples of net.sf.lapg.templates.api.ITemplate


    this.templatePackage = templatePackage;
  }

  @Override
  public String toString() {
    ITemplate templ = (ITemplate) evaluationStrategy.loadEntity(templatePackage+".symbol", IBundleEntity.KIND_TEMPLATE, null);
    return evaluationStrategy.evaluate(templ, new EvaluationContext(this), null, null);
  }
View Full Code Here


      loaded = new ITemplate[0];
    } else {
      loaded = p.getResult();
    }

    ITemplate t = loaded != null && loaded.length == 1
        && loaded[0].getKind() == IBundleEntity.KIND_TEMPLATE
        && loaded[0].getName().equals("inline")
          ? (ITemplate)loaded[0] : null;
    if (t == null) {
      return "";
    }
    try {
      return t.apply(context, this, null);
    } catch (EvaluationException ex) {
      fireError(t, ex.getMessage());
      return "";
    }
  }
View Full Code Here

  protected TemplatesRegistry createRegistry(IBundleLoader... loaders) {
    return new TemplatesRegistry(this, loaders);
  }

  public String executeTemplate(String name, EvaluationContext context, Object[] arguments, ILocatedEntity referer) {
    ITemplate t = (ITemplate) getEvaluationStrategy().loadEntity(name, IBundleEntity.KIND_TEMPLATE, referer);
    return getEvaluationStrategy().evaluate(t, context, arguments, referer);
  }
View Full Code Here

TOP

Related Classes of net.sf.lapg.templates.api.ITemplate

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.