/***********************************************************************/ public void setRuntimeLogger(RuntimeLogger runtimeLogger) { introspector = new IntrospectorBase(); introspectorWithLog = new Introspector(runtimeLogger); log = runtimeLogger; } public void setBeKindToNulls(boolean behavior)
@Override public void init() { super.init(); this.introspector = new Introspector(this.log); }
@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)); } }
public InvalidReferenceInfo(String invalidReference, Info info) { super(info.getTemplateName(),info.getLine(),info.getColumn()); this.invalidReference = invalidReference; }
/** * init - generates the Introspector. As the setup code * makes sure that the log gets set before this is called, * we can initialize the Introspector using the log object. */ public void init() { introspector = new Introspector(log, conversionHandler); }
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getMethod(java.lang.Object, java.lang.String, * java.lang.Object[], org.apache.velocity.util.introspection.Info) */ //@Override public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i) { return (this.inner != null) ? this.inner.getMethod(obj, methodName, args, i) : null; }
return executor.isAlive() ? new VelGetterImpl(executor) : null;
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getPropertySet(java.lang.Object, java.lang.String, * java.lang.Object, org.apache.velocity.util.introspection.Info) */ //@Override public VelPropertySet getPropertySet(Object obj, String identifier, Object arg, Info i) throws Exception { return (this.inner != null) ? this.inner.getPropertySet(obj, identifier, arg, i) : null; } }
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getPropertyGet(java.lang.Object, java.lang.String, * org.apache.velocity.util.introspection.Info) */ //@Override public VelPropertyGet getPropertyGet(Object obj, String identifier, Info i) { VelPropertyGet getter = leftUberspect.getPropertyGet(obj,identifier,i); return getter != null ? getter : rightUberspect.getPropertyGet(obj,identifier,i); }
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getIterator(java.lang.Object, * org.apache.velocity.util.introspection.Info) */ //@SuppressWarnings("unchecked") //@Override public Iterator getIterator(Object obj, Info i) throws Exception { return (this.inner != null) ? this.inner.getIterator(obj, i) : null; }
private static boolean isConvertible(Class formal, Class actual, boolean possibleVarArg) { return IntrospectionUtils. isMethodInvocationConvertible(formal, actual, possibleVarArg); }
private static boolean isStrictConvertible(Class formal, Class actual, boolean possibleVarArg) { return IntrospectionUtils. isStrictMethodInvocationConvertible(formal, actual, possibleVarArg); } }
@Override public void init() { super.init(); this.introspector = new Introspector(this.log); }
/** * Sets the runtime logger - this must be called before anything * else besides init() as to get the logger. Makes the pull * model appealing... */ public void setRuntimeLogger(RuntimeLogger runtimeLogger) { rlog = runtimeLogger; introspector = new Introspector(rlog); }
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getMethod(java.lang.Object, java.lang.String, * java.lang.Object[], org.apache.velocity.util.introspection.Info) */ //@Override public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i) throws Exception { return (this.inner != null) ? this.inner.getMethod(obj, methodName, args, i) : null; }
@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)); } }
return executor.isAlive() ? new VelGetterImpl(executor) : null;
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getPropertySet(java.lang.Object, java.lang.String, * java.lang.Object, org.apache.velocity.util.introspection.Info) */ //@Override public VelPropertySet getPropertySet(Object obj, String identifier, Object arg, Info i) { return (this.inner != null) ? this.inner.getPropertySet(obj, identifier, arg, i) : null; } }
/** * init - generates the Introspector. As the setup code * makes sure that the log gets set before this is called, * we can initialize the Introspector using the log object. */ public void init() { introspector = new Introspector(log); }
/** * {@inheritDoc} * * @see org.apache.velocity.util.introspection.Uberspect#getMethod(java.lang.Object, java.lang.String, * java.lang.Object[], org.apache.velocity.util.introspection.Info) */ //@Override public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i) { VelMethod method = leftUberspect.getMethod(obj,methodName,args,i); return method != null ? method : rightUberspect.getMethod(obj,methodName,args,i); }