Examples of FragmentList


Examples of cambridge.model.FragmentList

         assertEquals("and ", st2.toString());
         assertEquals("${b}", node2.getSource());

         StringWriter builder = new StringWriter();

         FragmentList fragmentList = t.normalize();

         assertEquals(5, fragmentList.size());

         assertTrue(fragmentList.get(0) instanceof StaticFragment);
         assertTrue(fragmentList.get(1) instanceof ExpressionNode);
         assertTrue(fragmentList.get(2) instanceof StaticFragment);
         assertTrue(fragmentList.get(3) instanceof ExpressionNode);
         assertTrue(fragmentList.get(4) instanceof StaticFragment);

         for (Fragment f : fragmentList) {
            f.eval(p, builder);
         }
View Full Code Here

Examples of cambridge.model.FragmentList

         assertEquals("${style}", node1.getSource());

         StringWriter builder = new StringWriter();

         FragmentList fragmentList = t.normalize();

         assertEquals(1, fragmentList.size());

         assertTrue(fragmentList.get(0) instanceof TagNode);

         for (Fragment f : fragmentList) {
            f.eval(p, builder);
         }
View Full Code Here

Examples of cambridge.model.FragmentList

   public static final String DefaultEncoding = "UTF-8";

   public TemplateFactory parseAndCreateTemplateFactory(String templateSource) throws TemplateLoadingException {
      TemplateDocument doc = parseAndCreateTemplateDocument(templateSource);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

Examples of cambridge.model.FragmentList

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

Examples of cambridge.model.FragmentList

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

Examples of cambridge.model.FragmentList

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

Examples of cambridge.model.FragmentList

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

Examples of cambridge.model.FragmentList

         ExpressionContext context = new MapExpressionContext();
         context.put("var1", true);

         TemplateDocument t = parser.parse();
         assertNotNull(t);
         FragmentList fragments = t.normalize();

         StringWriter builder = new StringWriter();

         for (Fragment f : fragments) {
            f.eval(context, builder);
View Full Code Here

Examples of cambridge.model.FragmentList

         ExpressionContext context = new MapExpressionContext();
         context.put("var2", true);

         TemplateDocument t = parser.parse();
         assertNotNull(t);
         FragmentList fragments = t.normalize();

         StringWriter builder = new StringWriter();

         for (Fragment f : fragments) {
            f.eval(context, builder);
View Full Code Here

Examples of cambridge.model.FragmentList

         ExpressionContext context = new MapExpressionContext();
         context.put("var3", true);

         TemplateDocument t = parser.parse();
         assertNotNull(t);
         FragmentList fragments = t.normalize();

         StringWriter builder = new StringWriter();

         for (Fragment f : fragments) {
            f.eval(context, builder);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.