Examples of TemplateException


Examples of freemarker.template.TemplateException

     void visitAttemptRecover(TemplateElement attemptBlock, RecoveryBlock recoveryBlock)
     throws TemplateException, IOException {
         Writer prevOut = this.out;
         StringWriter sw = new StringWriter();
         this.out = sw;
         TemplateException thrownException = null;
         boolean lastFIRE = setFastInvalidReferenceExceptions(false);
         boolean lastInAttemptBlock = inAttemptBlock;
         try {
             inAttemptBlock = true;
             visitByHiddingParent(attemptBlock);
View Full Code Here

Examples of freemarker.template.TemplateException

            Date date, int dateType, Environment env)
    throws TemplateException;
   
    static TemplateException newNonDateException(Environment env, TemplateModel model, Expression target)
            throws InvalidReferenceException {
        TemplateException e;
        if(model == null) {
            e = InvalidReferenceException.getInstance(target, env);
        } else {
            e = new NonDateException(target, model, "date", env);
        }
View Full Code Here

Examples of gap.hapax.TemplateException

            try {
                template.render(top,out);
            }
            catch (TemplateException exc){
                throw new TemplateException("In template '"+xtm.source+"'.",exc);
            }
        }
        else
            throw new IllegalArgumentException();
    }
View Full Code Here

Examples of gap.hapax.TemplateException

                template.render(top,out);

                return true;
            }
            catch (TemplateException exc){
                throw new TemplateException("In template '"+xtm.source+"'.",exc);
            }
        }
        else
            throw new IllegalArgumentException();
    }
View Full Code Here

Examples of gap.hapax.TemplateException

                template.render(top,out);

                return;
            }
            catch (TemplateException exc){
                throw new TemplateException("In template '"+xtm.source+"'.",exc);
            }
            finally {
                out.close();
            }
        }
View Full Code Here

Examples of gap.hapax.TemplateException

                    try {
                        template.render(top,out);
                    }
                    catch (TemplateException exc){
                        throw new TemplateException("In template '"+xtm.source+"'.",exc);
                    }
                }
                else
                    throw new TemplateException("Primitive type not found for name '"+childClassName+"'.");
 
            }
                break;
            case ListShort:
            case ListLong:{
                ClassDescriptor child = Classes.For(childClassName);
                if (null != child){

                    DefineClass(PackageFor(child,pkg),child,ImportsFor(child,imports),top,TemplateNames.PrefixChild);

                    top.setVariable(TemplateNames.ListClassName,listClassName);
                    if (gap.data.List.Type.ListShort == listType)
                        top.setVariable(TemplateNames.ListType,"Short");
                    else
                        top.setVariable(TemplateNames.ListType,"Long");

                    try {
                        template.render(top,out);
                    }
                    catch (TemplateException exc){
                        throw new TemplateException("In template '"+xtm.source+"'.",exc);
                    }
                }
                else if (null != childClass){

                    DefineClass(pkg,childClass,imports,top,TemplateNames.PrefixChild);

                    top.setVariable(TemplateNames.ListClassName,listClassName);
                    if (gap.data.List.Type.ListShort == listType)
                        top.setVariable(TemplateNames.ListType,"Short");
                    else
                        top.setVariable(TemplateNames.ListType,"Long");

                    try {
                        template.render(top,out);
                    }
                    catch (TemplateException exc){
                        throw new TemplateException("In template '"+xtm.source+"'.",exc);
                    }
                }
                else
                    throw new TemplateException("Child class descriptor not found for name '"+childClassName+"'.");
            }
                break;
            }
        }
        else
View Full Code Here

Examples of gap.hapax.TemplateException

                    try {
                        template.render(top,out);
                    }
                    catch (TemplateException exc){
                        throw new TemplateException("In template '"+xtm.source+"'.",exc);
                    }
                }
                else
                    throw new TemplateException("Primitive type not found for name '"+mapChild.childValueClassName+"'.");
            }
                break;
            case MapShort: //(fall-through)
            case MapLong:{
                ClassDescriptor child = Classes.For(mapChild.childValueClassName);
                if (null != child){

                    DefineClass(PackageFor(child,pkg),child,ImportsFor(child,imports),top,TemplateNames.PrefixChild);

                    top.setVariable(TemplateNames.MapClassName,mapClassName);
                    top.setVariable(TemplateNames.MapKeyType,mapChild.childKeyFieldType);
                    top.setVariable(TemplateNames.MapKeyFieldName,mapChild.childKeyFieldName);
                    top.setVariable(TemplateNames.MapKeyFieldNameCamel,Camel(mapChild.childKeyFieldName));

                    try {
                        template.render(top,out);
                    }
                    catch (TemplateException exc){
                        throw new TemplateException("In template '"+xtm.source+"'.",exc);
                    }
                }
                else if (null != childClass){

                    DefineClass(pkg,childClass,imports,top,TemplateNames.PrefixChild);

                    top.setVariable(TemplateNames.MapClassName,mapClassName);
                    top.setVariable(TemplateNames.MapKeyType,mapChild.childKeyFieldType);
                    top.setVariable(TemplateNames.MapKeyFieldName,mapChild.childKeyFieldName);
                    top.setVariable(TemplateNames.MapKeyFieldNameCamel,Camel(mapChild.childKeyFieldName));

                    try {
                        template.render(top,out);
                    }
                    catch (TemplateException exc){
                        throw new TemplateException("In template '"+xtm.source+"'.",exc);
                    }
                }
                else
                    throw new TemplateException("Child class descriptor not found for name '"+mapChild.childValueClassName+"'.");
            }
                break;
            }
        }
        else
View Full Code Here

Examples of gap.hapax.TemplateException

                    this.put(templateResource,template);

                    return new gap.hapax.TemplateRendererImpl(this,template);
                }
                catch (IOException iox){
                    throw new TemplateException(templateResource.toString(),iox);
                }
            }
        }
        else
            return new gap.hapax.TemplateRendererImpl(this,template);
View Full Code Here

Examples of gap.hapax.TemplateException

            String target = template.toString();

            if (null != source && null != target && target.equals(source.getValue()))
                return true;
            else if (null == source)
                throw new TemplateException(String.format("Missing source for '%s'",name));
            else if (null == target)
                throw new TemplateException(String.format("Missing target for '%s'",name));
            else {
                String sourceString = source.getValue();
                if (null == sourceString)
                    throw new TemplateException(String.format("Missing source string for '%s'",name));
                else {
                    System.err.printf("Template Source '%s'%n",name);
                    System.err.println(sourceString);
                    System.err.printf("Template Target '%s'%n",name);
                    System.err.println(target);
                    return false;
                }
            }
        }
        else {
            throw new TemplateException(String.format("Missing template '%s'",name));
        }
    }
View Full Code Here

Examples of juzu.impl.template.spi.TemplateException

  public final ASTNode.Template parse(ParseContext context, CharSequence source) throws TemplateException {
    try {
      return ASTNode.Template.parse(source);
    }
    catch (ParseException e) {
      throw new TemplateException(e);
    }
  }
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.