Package cambridge.model

Examples of cambridge.model.TemplateDocument


    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, expressionLanguage);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here


    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, String encoding, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, encoding, expressionLanguage);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, TemplateModifier modifier, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, expressionLanguage);
      modifier.modifyTemplate(doc);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, String encoding, TemplateModifier modifier, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, encoding, expressionLanguage);
      modifier.modifyTemplate(doc);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

    {
        FileTemplateLoader l = (FileTemplateLoader) loader;
        try
        {
            reloading = true;
            TemplateDocument doc = l.parseTemplate(templateFile, encoding, expressionLanguage);
            if (modifier != null)
            {
                modifier.modifyTemplate(doc);
            }

            if (doc.getIncludes() != null)
            {
                includes = l.getFiles(doc.getIncludes());
            }

            fragments = doc.normalize();

            lastReload = System.currentTimeMillis();
        }
        catch (TemplateLoadingException e)
        {
View Full Code Here

    * @param cl The TagNode implementation class.
    * @return Returns the newly created tag node object which contains the template contents.
    * @throws TemplateLoadingException Might be thrown if there is a problem in parsing the provided template.
    */
   public <T extends TagNode> T createTag(InputStream in, Class<T> cl, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      TemplateDocument doc = loader.parseTemplate(in, expressionLanguage);
      ArrayList<TemplateNode> nodes = doc.getChildren();

      try {
         T tag = cl.newInstance();
         tag.addChildren(nodes);
         return tag;
View Full Code Here

    * @param cl The TagNode implementation class.
    * @return Returns the newly created tag node object which contains the template contents.
    * @throws TemplateLoadingException Might be thrown if there is a problem in parsing the provided template.
    */
   public <T extends TagNode> T createTag(File tagTemplate, Class<T> cl, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      TemplateDocument doc = loader.parseTemplate(tagTemplate, expressionLanguage);
      ArrayList<TemplateNode> nodes = doc.getChildren();

      try {
         T tag = cl.newInstance();
         tag.addChildren(nodes);
         return tag;
View Full Code Here

TOP

Related Classes of cambridge.model.TemplateDocument

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.