public InvalidReferenceInfo(String invalidReference, Info info) { super(info.getTemplateName(),info.getLine(),info.getColumn()); this.invalidReference = invalidReference; }
@Override public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { Node escapeTypeNode = node.jjtGetChild(0); Object escapeTypeObject = escapeTypeNode.value(context); String escapeTypeString = escapeTypeObject == null ? null : escapeTypeObject.toString(); EscapeType escapeType = EscapeType.getEscapeType(escapeTypeString); if (escapeType == null) { throw new ParseErrorException("Invalid escape type: " + escapeTypeObject + " at " + new Info(escapeTypeNode.getTemplateName(), escapeTypeNode.getColumn(), escapeTypeNode.getLine()) + ". Available escape types: " + EscapeType.getNames()); } return renderWithEscape(escapeType, context, writer, node.jjtGetChild(1)); } }
static String buildDeprecatedMethodAccessMessage(String prefix, Class targetClass, final Method method, final Info info) { return String.format( "%s %s#%s - %s", prefix, targetClass.getCanonicalName(), method.getName(), info.toString()); }
method = rsvc.getUberspect().getMethod(o, methodName, params, new Info(getTemplateName(), getLine(), getColumn())); null, methodName, uberInfo.getTemplateName(), uberInfo.getLine(), uberInfo.getColumn());
throw new VelocityException("Attempted to access '" + name + "' on a null value at " + Log.formatFileString(uberInfo.getTemplateName(), + jjtGetChild(i).getLine(), jjtGetChild(i).getColumn()));
throw new VelocityException("Attempted to access '" + name + "' on a null value at " + Log.formatFileString(uberInfo.getTemplateName(), + jjtGetChild(i).getLine(), jjtGetChild(i).getColumn()));
public InvalidReferenceInfo(String invalidReference, Info info) { super(info.getTemplateName(),info.getLine(),info.getColumn()); this.invalidReference = invalidReference; }
@Override public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { Node escapeTypeNode = node.jjtGetChild(0); Object escapeTypeObject = escapeTypeNode.value(context); String escapeTypeString = escapeTypeObject == null ? null : escapeTypeObject.toString(); EscapeType escapeType = EscapeType.getEscapeType(escapeTypeString); if (escapeType == null) { throw new ParseErrorException("Invalid escape type: " + escapeTypeObject + " at " + new Info(escapeTypeNode.getTemplateName(), escapeTypeNode.getColumn(), escapeTypeNode.getLine()) + ". Available escape types: " + EscapeType.getNames()); } return renderWithEscape(escapeType, context, writer, node.jjtGetChild(1)); } }
throw new VelocityException("Attempted to access '" + name + "' on a null value at " + StringUtils.formatFileString(uberInfo.getTemplateName(), + jjtGetChild(i).getLine(), jjtGetChild(i).getColumn()));
public InvalidReferenceInfo(String invalidReference, Info info) { super(info.getTemplateName(),info.getLine(),info.getColumn()); this.invalidReference = invalidReference; }
@Override public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException { Node escapeTypeNode = node.jjtGetChild(0); Object escapeTypeObject = escapeTypeNode.value(context); String escapeTypeString = escapeTypeObject == null ? null : escapeTypeObject.toString(); EscapeType escapeType = EscapeType.getEscapeType(escapeTypeString); if (escapeType == null) { throw new ParseErrorException("Invalid escape type: " + escapeTypeObject + " at " + new Info(escapeTypeNode.getTemplateName(), escapeTypeNode.getColumn(), escapeTypeNode.getLine()) + ". Available escape types: " + EscapeType.getNames()); } return renderWithEscape(escapeType, context, writer, node.jjtGetChild(1)); } }
/** * Create a ParseErrorRuntimeException with the given message and info * * @param exceptionMessage the error exception message * @param info an Info object with the current template info * @since 1.5 */ public ParseErrorException(String exceptionMessage, Info info) { super(exceptionMessage); columnNumber = info.getColumn(); lineNumber = info.getLine(); templateName = info.getTemplateName(); }
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. */ public Object init(InternalContextAdapter context, Object data) throws Exception { super.init(context, data); identifier = getFirstToken().image; uberInfo = new Info(context.getCurrentTemplateName(), getLine(), getColumn()); return data; }
/***********************************************************************/ public static String getInfoText(Info i) { return " at [" + i.getLine() + "," + i.getColumn() + "]" + " in template " + i.getTemplateName(); } public Info getInfo()
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. * @param context * @param data * @return The data object. * @throws TemplateInitException */ public Object init(InternalContextAdapter context, Object data) throws TemplateInitException { super.init(context, data); identifier = getFirstToken().image.intern(); uberInfo = new Info(getTemplateName(), getLine(), getColumn()); strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); return data; }
/** * Create a ParseErrorRuntimeException with the given message and info * * @param exceptionMessage the error exception message * @param info an Info object with the current template info * @since 1.5 */ public ParseErrorException(String exceptionMessage, Info info) { super(exceptionMessage); columnNumber = info.getColumn(); lineNumber = info.getLine(); templateName = info.getTemplateName(); }
/** * simple init - don't do anything that is context specific. * just get what we need from the AST, which is static. * @param context * @param data * @return The data object. * @throws TemplateInitException */ public Object init(InternalContextAdapter context, Object data) throws TemplateInitException { super.init(context, data); identifier = getFirstToken().image; uberInfo = new Info(getTemplateName(), getLine(), getColumn()); strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false); return data; }
/** * Create a ParseErrorRuntimeException with the given message and info * * @param exceptionMessage the error exception message * @param info an Info object with the current template info * @since 1.5 */ public ParseErrorException(String exceptionMessage, Info info) { super(exceptionMessage); columnNumber = info.getColumn(); lineNumber = info.getLine(); templateName = info.getTemplateName(); }
params[j] = jjtGetChild(j + 1).value(context); method = rsvc.getUberspect().getMethod(o, methodName, params, new Info("",1,1));
/** * Create a ParseErrorRuntimeException with the given message and info * * @param exceptionMessage the error exception message * @param info an Info object with the current template info * @param invalidSyntax the invalid syntax or reference triggering this exception * @since 1.5 */ public ParseErrorException(String exceptionMessage, Info info, String invalidSyntax) { super(exceptionMessage); columnNumber = info.getColumn(); lineNumber = info.getLine(); templateName = info.getTemplateName(); this.invalidSyntax = invalidSyntax; }