/** * Gets a method argument and checks if it's a string; it does NOT check if {@code args} is big enough. */ protected final String getStringMethodArg(List args, int argIdx) throws TemplateModelException { TemplateModel arg = (TemplateModel) args.get(argIdx); if (!(arg instanceof TemplateScalarModel)) { throw _MessageUtil.newMethodArgMustBeStringException("?" + key, argIdx, arg); } else { return EvalUtil.modelToString((TemplateScalarModel) arg, null, null); } }
throw _MessageUtil.newMethodArgMustBeStringException(methodName, 0, arg);
/** * Gets a method argument and checks if it's a string; it does NOT check if {@code args} is big enough. */ protected final String getStringMethodArg(List args, int argIdx) throws TemplateModelException { TemplateModel arg = (TemplateModel) args.get(argIdx); if (!(arg instanceof TemplateScalarModel)) { throw _MessageUtil.newMethodArgMustBeStringException("?" + key, argIdx, arg); } else { return EvalUtil.modelToString((TemplateScalarModel) arg, null, null); } }
/** * Gets a method argument and checks if it's a string; it does NOT check if {@code args} is big enough. */ protected final String getStringMethodArg(List args, int argIdx) throws TemplateModelException { TemplateModel arg = (TemplateModel) args.get(argIdx); if (!(arg instanceof TemplateScalarModel)) { throw _MessageUtil.newMethodArgMustBeStringException("?" + key, argIdx, arg); } else { return EvalUtil.modelToString((TemplateScalarModel) arg, null, null); } }
throw _MessageUtil.newMethodArgMustBeStringException(methodName, 0, arg);
throw _MessageUtil.newMethodArgMustBeStringException(methodName, 0, arg);