• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MethodNotFoundException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.el.MethodNotFoundException的典型用法代码示例。如果您正苦于以下问题:Java MethodNotFoundException类的具体用法?Java MethodNotFoundException怎么用?Java MethodNotFoundException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MethodNotFoundException类属于javax.el包,在下文中一共展示了MethodNotFoundException类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: invokeTarget

import javax.el.MethodNotFoundException; //导入依赖的package包/类
private final Object invokeTarget(EvaluationContext ctx, Object target,
        Object[] paramValues) throws ELException {
    if (target instanceof MethodExpression) {
        MethodExpression me = (MethodExpression) target;
        return me.invoke(ctx.getELContext(), paramValues);
    } else if (target == null) {
        throw new MethodNotFoundException("Identity '" + this.image
                + "' was null and was unable to invoke");
    } else {
        throw new ELException(
                "Identity '"
                        + this.image
                        + "' does not reference a MethodExpression instance, returned type: "
                        + target.getClass().getName());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AstIdentifier.java


示例2: getMethod

import javax.el.MethodNotFoundException; //导入依赖的package包/类
/**
 * Returns a method based on the criteria
 * @param base the object that owns the method
 * @param property the name of the method
 * @param paramTypes the parameter types to use
 * @return the method specified
 * @throws MethodNotFoundException
 */
public static Method getMethod(Object base, Object property,
        Class[] paramTypes) throws MethodNotFoundException {
    if (base == null || property == null) {
        throw new MethodNotFoundException(MessageFactory.get(
                "error.method.notfound", base, property,
                paramString(paramTypes)));
    }

    String methodName = (property instanceof String) ? (String) property
            : property.toString();

    Method method = null;
    try {
        method = base.getClass().getMethod(methodName, paramTypes);
    } catch (NoSuchMethodException nsme) {
        throw new MethodNotFoundException(MessageFactory.get(
                "error.method.notfound", base, property,
                paramString(paramTypes)));
    }
    return method;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:ReflectionUtil.java


示例3: testEvaluate_lambda

import javax.el.MethodNotFoundException; //导入依赖的package包/类
/**
 * ラムダ式のテスト - EL2.xでは非さぽーとのため失敗する
 */
@Test(expected=ExpressionEvaluationException.class)
public void testEvaluate_lambda() {
    
    String expression = "sum=0;list.stream().forEach(x->(sum=sum+x));sum";
    
    Map<String, Object> vars = new HashMap<>();
    vars.put("list", Arrays.asList(1, 2, 3, 4, 5, 6));
    
    try {
        el.evaluate(expression, vars);
        fail();
        
    } catch(Exception e) {
        assertThat(e, is(instanceOf(ExpressionEvaluationException.class)));
        assertThat(e.getCause(), is(instanceOf(MethodNotFoundException.class)));
        
        throw e;
    }
    
}
 
开发者ID:mygreen,项目名称:xlsmapper,代码行数:24,代码来源:ExpressionLangaugeEL2ImplTest.java


示例4: findMethod

import javax.el.MethodNotFoundException; //导入依赖的package包/类
public static Method findMethod(Object base, Object name, Object[] params) {
        Method r = null;
        if (base != null && name != null) {
            Class type = base.getClass();
            String methodName = ELSupport.coerceToString(name);
            MethodCache m = methodCache.get(type);
//            if (m == null || type != m.getType()) {
//                m = new MethodCache(type);
//                methodCache.set(type, m);
//            }
            r = m.findMethod(methodName, params);
            if (r == null) {
                throw new MethodNotFoundException(MessageFactory.get(
                        "error.method.notfound", base, name,
                        paramString(paramTypes(params))));
            }
        } else {
            throw new MethodNotFoundException();
        }
        return r;
    }
 
开发者ID:seam2,项目名称:jboss-el,代码行数:22,代码来源:ReflectionUtil.java


示例5: getMethod

import javax.el.MethodNotFoundException; //导入依赖的package包/类
/**
 * Returns a method based on the criteria
 *
 * @param base
 *            the object that owns the method
 * @param property
 *            the name of the method
 * @param paramTypes
 *            the parameter types to use
 * @return the method specified
 * @throws MethodNotFoundException
 */
public static Method getMethod(Object base, Object property,
        Class[] paramTypes) throws MethodNotFoundException {
    if (base == null || property == null) {
        throw new MethodNotFoundException(MessageFactory.get(
                "error.method.notfound", base, property,
                paramString(paramTypes)));
    }
    
    String methodName = (property instanceof String) ? (String) property
            : property.toString();
    
    Method method = null;
    try {
        method = base.getClass().getMethod(methodName, paramTypes);
    } catch (NoSuchMethodException nsme) {
        throw new MethodNotFoundException(MessageFactory.get(
                "error.method.notfound", base, property,
                paramString(paramTypes)));
    }
    return method;
}
 
开发者ID:seam2,项目名称:jboss-el,代码行数:34,代码来源:ReflectionUtil.java


示例6: getMethodExpression

import javax.el.MethodNotFoundException; //导入依赖的package包/类
private final MethodExpression getMethodExpression(EvaluationContext ctx)
        throws ELException {
    Object obj = null;

    // case A: ValueExpression exists, getValue which must
    // be a MethodExpression
    VariableMapper varMapper = ctx.getVariableMapper();
    ValueExpression ve = null;
    if (varMapper != null) {
        ve = varMapper.resolveVariable(this.image);
        if (ve != null) {
            obj = ve.getValue(ctx);
        }
    }

    // case B: evaluate the identity against the ELResolver, again, must be
    // a MethodExpression to be able to invoke
    if (ve == null) {
        ctx.setPropertyResolved(false);
        obj = ctx.getELResolver().getValue(ctx, null, this.image);
    }

    // finally provide helpful hints
    if (obj instanceof MethodExpression) {
        return (MethodExpression) obj;
    } else if (obj == null) {
        throw new MethodNotFoundException("Identity '" + this.image
                + "' was null and was unable to invoke");
    } else {
        throw new ELException(
                "Identity '"
                        + this.image
                        + "' does not reference a MethodExpression instance, returned type: "
                        + obj.getClass().getName());
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:37,代码来源:AstIdentifier.java


示例7: getMethodExpression

import javax.el.MethodNotFoundException; //导入依赖的package包/类
private final MethodExpression getMethodExpression(EvaluationContext ctx) throws ELException {
	Object obj = null;

	// case A: ValueExpression exists, getValue which must
	// be a MethodExpression
	VariableMapper varMapper = ctx.getVariableMapper();
	ValueExpression ve = null;
	if (varMapper != null) {
		ve = varMapper.resolveVariable(this.image);
		if (ve != null) {
			obj = ve.getValue(ctx);
		}
	}

	// case B: evaluate the identity against the ELResolver, again, must be
	// a MethodExpression to be able to invoke
	if (ve == null) {
		ctx.setPropertyResolved(false);
		obj = ctx.getELResolver().getValue(ctx, null, this.image);
	}

	// finally provide helpful hints
	if (obj instanceof MethodExpression) {
		return (MethodExpression) obj;
	} else if (obj == null) {
		throw new MethodNotFoundException("Identity '" + this.image + "' was null and was unable to invoke");
	} else {
		throw new ELException("Identity '" + this.image
				+ "' does not reference a MethodExpression instance, returned type: " + obj.getClass().getName());
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:32,代码来源:AstIdentifier.java


示例8: invoke

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Override
public Object invoke(final ELContext context, final Object base, final Object method,
    final Class<?>[] paramTypes, final Object[] params) {
  if (resolveType(base)) {
    if (isStrictMode) {
      throw new MethodNotFoundException();
    }
  }

  return null;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:12,代码来源:BuilderELResolver.java


示例9: findMethodOrThrow

import javax.el.MethodNotFoundException; //导入依赖的package包/类
protected Method findMethodOrThrow(final String methodName, final Class<?>[] paramTypes,
    final Object[] params, final boolean staticOnly, final MethodDescriptor[] methodDescriptors) {
  final Method method = findMethod(methodName, paramTypes, params, staticOnly, methodDescriptors);

  if (method == null) {
    throw new MethodNotFoundException("Method " + methodName + "for bean class "
        + "not found or accessible");
  }

  return method;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:12,代码来源:BeanELResolverEx.java


示例10: invoke

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Override
public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
  if (method == null || RESTRICTED_METHODS.contains(method.toString())) {
    throw new MethodNotFoundException("Cannot find method '" + method + "' in " + base.getClass());
  }
  return super.invoke(context, base, method, paramTypes, params);
}
 
开发者ID:HubSpot,项目名称:jinjava,代码行数:8,代码来源:JinjavaBeanELResolver.java


示例11: getMethodExpression

import javax.el.MethodNotFoundException; //导入依赖的package包/类
private final MethodExpression getMethodExpression(EvaluationContext ctx)
		throws ELException {
	Object obj = null;

	// case A: ValueExpression exists, getValue which must
	// be a MethodExpression
	VariableMapper varMapper = ctx.getVariableMapper();
	ValueExpression ve = null;
	if (varMapper != null) {
		ve = varMapper.resolveVariable(this.image);
		if (ve != null) {
			obj = ve.getValue(ctx);
		}
	}

	// case B: evaluate the identity against the ELResolver, again, must be
	// a MethodExpression to be able to invoke
	if (ve == null) {
		ctx.setPropertyResolved(false);
		obj = ctx.getELResolver().getValue(ctx, null, this.image);
	}

	// finally provide helpful hints
	if (obj instanceof MethodExpression) {
		return (MethodExpression) obj;
	} else if (obj == null) {
		throw new MethodNotFoundException("Identity '" + this.image
				+ "' was null and was unable to invoke");
	} else {
		throw new ELException(
				"Identity '"
						+ this.image
						+ "' does not reference a MethodExpression instance, returned type: "
						+ obj.getClass().getName());
	}
}
 
开发者ID:seam2,项目名称:jboss-el,代码行数:37,代码来源:AstIdentifier.java


示例12: JspMethodNotFoundException

import javax.el.MethodNotFoundException; //导入依赖的package包/类
public JspMethodNotFoundException(String mark, MethodNotFoundException e) {
    super(mark + " " + e.getMessage(), e.getCause());
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:4,代码来源:JspMethodNotFoundException.java


示例13: testBug54370a

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Test(expected=MethodNotFoundException.class)
public void testBug54370a() {
    ReflectionUtil.getMethod(BASE, "testA",
            new Class[] {null, String.class},
            new Object[] {null, ""});
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:7,代码来源:TestReflectionUtil.java


示例14: testBug54370b

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Test(expected=MethodNotFoundException.class)
public void testBug54370b() {
    ReflectionUtil.getMethod(BASE, "testB",
            new Class[] {null, String.class},
            new Object[] {null, ""});
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:7,代码来源:TestReflectionUtil.java


示例15: JspMethodNotFoundException

import javax.el.MethodNotFoundException; //导入依赖的package包/类
public JspMethodNotFoundException(String mark, MethodNotFoundException e) {
	super(mark + " " + e.getMessage(), e.getCause());
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:4,代码来源:JspMethodNotFoundException.java


示例16: create

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Override
public ExperimentCatResource create(ResourceType type) throws RegistryException {
    throw new MethodNotFoundException();
}
 
开发者ID:apache,项目名称:airavata,代码行数:5,代码来源:ExperimentSummaryResource.java


示例17: remove

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Override
public void remove(ResourceType type, Object name) throws RegistryException {
    throw new MethodNotFoundException();
}
 
开发者ID:apache,项目名称:airavata,代码行数:5,代码来源:ExperimentSummaryResource.java


示例18: get

import javax.el.MethodNotFoundException; //导入依赖的package包/类
@Override
public ExperimentCatResource get(ResourceType type, Object name) throws RegistryException {
    throw new MethodNotFoundException();
}
 
开发者ID:apache,项目名称:airavata,代码行数:5,代码来源:ExperimentSummaryResource.java



注:本文中的javax.el.MethodNotFoundException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VertxException类代码示例发布时间:2022-05-21
下一篇:
Java GlyphFontRegistry类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap