类org.apache.velocity.util.introspection.VelMethod源码实例Demo

下面列出了怎么用org.apache.velocity.util.introspection.VelMethod的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ApprovalTests.Java   文件: TestableUberspect.java
public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i) throws Exception
{
  if (obj == null)
  {
    if (beKindToNulls)
    {
      return null;
    }
    else
    {
      throw new VelocityParsingError("tried " + getMethodText("null", methodName, args), i);
    }
  }
  Method m = introspector.getMethod(obj.getClass(), methodName, args);
  if (m == null)
  {
    throw new VelocityParsingError(
        "Method " + getMethodText(obj.getClass().getName(), methodName, args) + " does not exist.", i);
  }
  return new VelMethodImpl(m);
}
 
源代码2 项目: openemm   文件: AgnVelocityUberspector.java
@Override
public VelMethod getMethod(Object obj, String methodName, Object[] args, Info info) throws Exception {
	
	if( isRuntimeCheckEnabled()) {
		checkRestrictedPackage( obj);

		if( this.packageChecker.includePackage( obj.getClass().getPackage())) {
			checkMethodAccess( obj, methodName, args, info);
		}
	}
	
	return super.getMethod(obj, methodName, args, info);
}
 
源代码3 项目: velocity-engine   文件: UberspectTestImpl.java
public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i)
{
    VelMethod method = super.getMethod(obj, methodName, args, i);

    if (method == null)
    {
        if (obj == null)
            throw new UberspectTestException("Can't call method '" + methodName + "' on null object",i);
        else
            throw new UberspectTestException("Did not find method "+ obj.getClass().getName()+"."+methodName, i);
    }

    return method;
}
 
源代码4 项目: openemm   文件: UberspectDelegate.java
@Override
public VelMethod getMethod(Object obj, String method, Object[] args, Info info) throws Exception {
	return uberspector.getMethod( obj, method, args, info);
}
 
源代码5 项目: ApprovalTests.Java   文件: TestableUberspect.java
public VelSetterImpl(VelMethod velmethod)
{
  this.vm = velmethod;
}
 
源代码6 项目: ApprovalTests.Java   文件: TestableUberspect.java
public VelSetterImpl(VelMethod velmethod, String key)
{
  this.vm = velmethod;
  putKey = key;
}
 
 类所在包
 类方法
 同包方法