Package freemarker.core

Examples of freemarker.core._DelayedOrdinal


                                getUnwrappedActualParameterTypes(unwrappedArgs) + "." }
                        : (Object) ""};
    }

    private _DelayedConversionToString memberListToString() {
        return new _DelayedConversionToString(null) {
           
            protected String doConversion(Object obj) {
                final Iterator fixArgMethodsIter = fixArgMethods.getMemberDescriptors();
                final Iterator varargMethodsIter = varargMethods != null ? varargMethods.getMemberDescriptors() : null;
               
View Full Code Here


    }

    public static TemplateModelException newInvocationTemplateModelException(Object object, CallableMemberDescriptor callableMemberDescriptor, Throwable e) {
        return newInvocationTemplateModelException(
                object,
                new _DelayedConversionToString(callableMemberDescriptor) {
                    protected String doConversion(Object callableMemberDescriptor) {
                        return ((CallableMemberDescriptor) callableMemberDescriptor).getDeclaration();
                    }
                },
                callableMemberDescriptor.isStatic(),
View Full Code Here

                if(val == CAN_NOT_UNWRAP) {
                    if (tryOnly) {
                        return CAN_NOT_UNWRAP;
                    } else {
                        throw new _TemplateModelException(new Object[] {
                                "Failed to convert "new _DelayedFTLTypeDescription(seq),
                                " object to ", new _DelayedShortClassName(array.getClass()),
                                ": Problematic sequence item at index ", new Integer(i) ," with value type: ",
                                new _DelayedFTLTypeDescription(seqItem)});
                    }
                   
                }
                Array.set(array, i, val);
            }
View Full Code Here

            int argIdx, TemplateModel argVal, Class targetType) {
        return new _TemplateModelException(new Object[] {
                _MethodUtil.invocationErrorMessageStart(member), " couldn't be called: Can't convert the ",
                new _DelayedOrdinal(new Integer(argIdx + 1)),
                " argument's value to the target Java type, ", ClassUtil.getShortClassName(targetType),
                ". The type of the actual value was: ", new _DelayedFTLTypeDescription(argVal),
                });
    }
View Full Code Here

        catch(Exception e)
        {
            throw new _TemplateModelException(e, new Object [] {
                    "An error has occurred when reading existing sub-variable ", new _DelayedJQuote(key),
                    "; see cause exception! The type of the containing value was: ",
                    new _DelayedFTLTypeDescription(this)
            });
        }
    }
View Full Code Here

            throw new _MiscTemplateException(env, "Missing required parameter \"path\"");
        }
        if(!(path instanceof TemplateScalarModel)) {
            throw new _MiscTemplateException(env, new Object[] {
                    "Expected a scalar model. \"path\" is instead ",
                    new _DelayedFTLTypeDescription(path) });
        }
        final String strPath = ((TemplateScalarModel)path).getAsString();
        if(strPath == null) {
            throw new _MiscTemplateException(env, "String value of \"path\" parameter is null");
        }
View Full Code Here

    public static Object[] invocationErrorMessageStart(Member member) {
        return invocationErrorMessageStart(member, member instanceof Constructor);
    }
   
    private static Object[] invocationErrorMessageStart(Object member, boolean isConstructor) {
        return new Object[] { "Java ", isConstructor ? "constructor " : "method ", new _DelayedJQuote(member) };
    }
View Full Code Here

        return new _TemplateModelException(e, new Object[] {
                invocationErrorMessageStart(member, isConstructor),
                " threw an exception",
                isStatic || isConstructor ? (Object) "" : new Object[] {
                    " when invoked on ", parentObject.getClass(), " object ", new _DelayedJQuote(parentObject)
                },
                "; see cause exception in the Java stack trace."
        });
    }
View Full Code Here

            throw e;
        }
        catch(Exception e)
        {
            throw new _TemplateModelException(e, new Object [] {
                    "An error has occurred when reading existing sub-variable ", new _DelayedJQuote(key),
                    "; see cause exception! The type of the containing value was: ",
                    new _DelayedFTLTypeDescription(this)
            });
        }
    }
View Full Code Here

    private TemplateModelException createArgumentTypeMismarchException(
            int argIdx, TemplateModel argVal, Class targetType) {
        return new _TemplateModelException(new Object[] {
                _MethodUtil.invocationErrorMessageStart(member), " couldn't be called: Can't convert the ",
                new _DelayedOrdinal(new Integer(argIdx + 1)),
                " argument's value to the target Java type, ", ClassUtil.getShortClassName(targetType),
                ". The type of the actual value was: ", new _DelayedFTLTypeDescription(argVal),
                });
    }
View Full Code Here

TOP

Related Classes of freemarker.core._DelayedOrdinal

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.