當前位置: 首頁>>代碼示例>>Java>>正文


Java FunctionMapper.resolveFunction方法代碼示例

本文整理匯總了Java中javax.el.FunctionMapper.resolveFunction方法的典型用法代碼示例。如果您正苦於以下問題:Java FunctionMapper.resolveFunction方法的具體用法?Java FunctionMapper.resolveFunction怎麽用?Java FunctionMapper.resolveFunction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.el.FunctionMapper的用法示例。


在下文中一共展示了FunctionMapper.resolveFunction方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getType

import javax.el.FunctionMapper; //導入方法依賴的package包/類
@Override
public Class<?> getType(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }
    return m.getReturnType();
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:18,代碼來源:AstFunction.java

示例2: getType

import javax.el.FunctionMapper; //導入方法依賴的package包/類
public Class getType(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }
    return m.getReturnType();
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:AstFunction.java

示例3: getType

import javax.el.FunctionMapper; //導入方法依賴的package包/類
public Class getType(EvaluationContext ctx)
throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }
    return m.getReturnType();
}
 
開發者ID:seam2,項目名稱:jboss-el,代碼行數:17,代碼來源:AstFunction.java

示例4: getValue

import javax.el.FunctionMapper; //導入方法依賴的package包/類
public Object getValue(EvaluationContext ctx)
throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }
    
    // If no params, there are no children, jjtGetNumChildren returns 0 if no children, not NPE
    Object[] params = new Object[this.jjtGetNumChildren()];
    for (int i = 0; i < this.jjtGetNumChildren(); i++) {
        params[i] = this.children[i].getValue(ctx);
    }
    
    return ReflectionUtil.invokeMethod(null, m, params);
}
 
開發者ID:seam2,項目名稱:jboss-el,代碼行數:24,代碼來源:AstFunction.java

示例5: getType

import javax.el.FunctionMapper; //導入方法依賴的package包/類
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {

	FunctionMapper fnMapper = ctx.getFunctionMapper();

	// quickly validate again for this request
	if (fnMapper == null) {
		throw new ELException(MessageFactory.get("error.fnMapper.null"));
	}
	Method m = fnMapper.resolveFunction(this.prefix, this.localName);
	if (m == null) {
		throw new ELException(MessageFactory.get("error.fnMapper.method", this.getOutputName()));
	}
	return m.getReturnType();
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:16,代碼來源:AstFunction.java

示例6: getValue

import javax.el.FunctionMapper; //導入方法依賴的package包/類
@Override
public Object getValue(EvaluationContext ctx) throws ELException {

	FunctionMapper fnMapper = ctx.getFunctionMapper();

	// quickly validate again for this request
	if (fnMapper == null) {
		throw new ELException(MessageFactory.get("error.fnMapper.null"));
	}
	Method m = fnMapper.resolveFunction(this.prefix, this.localName);
	if (m == null) {
		throw new ELException(MessageFactory.get("error.fnMapper.method", this.getOutputName()));
	}

	Class<?>[] paramTypes = m.getParameterTypes();
	Object[] params = null;
	Object result = null;
	int inputParameterCount = this.jjtGetNumChildren();
	int methodParameterCount = paramTypes.length;
	if (inputParameterCount == 0 && methodParameterCount == 1 && m.isVarArgs()) {
		params = new Object[] { null };
	} else if (inputParameterCount > 0) {
		params = new Object[methodParameterCount];
		try {
			for (int i = 0; i < methodParameterCount; i++) {
				if (m.isVarArgs() && i == methodParameterCount - 1) {
					if (inputParameterCount < methodParameterCount) {
						params[i] = new Object[] { null };
					} else if (inputParameterCount == methodParameterCount && paramTypes[i].isArray()) {
						params[i] = this.jjtGetChild(i).getValue(ctx);
					} else {
						Object[] varargs = new Object[inputParameterCount - methodParameterCount + 1];
						Class<?> target = paramTypes[i].getComponentType();
						for (int j = i; j < inputParameterCount; j++) {
							varargs[j - i] = this.jjtGetChild(j).getValue(ctx);
							varargs[j - i] = coerceToType(varargs[j - i], target);
						}
						params[i] = varargs;
					}
				} else {
					params[i] = this.jjtGetChild(i).getValue(ctx);
				}
				params[i] = coerceToType(params[i], paramTypes[i]);
			}
		} catch (ELException ele) {
			throw new ELException(MessageFactory.get("error.function", this.getOutputName()), ele);
		}
	}
	try {
		result = m.invoke(null, params);
	} catch (IllegalAccessException iae) {
		throw new ELException(MessageFactory.get("error.function", this.getOutputName()), iae);
	} catch (InvocationTargetException ite) {
		Throwable cause = ite.getCause();
		if (cause instanceof ThreadDeath) {
			throw (ThreadDeath) cause;
		}
		if (cause instanceof VirtualMachineError) {
			throw (VirtualMachineError) cause;
		}
		throw new ELException(MessageFactory.get("error.function", this.getOutputName()), cause);
	}
	return result;
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:65,代碼來源:AstFunction.java

示例7: resolveFunction

import javax.el.FunctionMapper; //導入方法依賴的package包/類
public Method resolveFunction(String prefix, String localName) {
  for (FunctionMapper functionMapper : functionMappers) {
    Method method = functionMapper.resolveFunction(prefix, localName);
    if (method != null) {
      return method;
    }
  }
  throw LOG.unknownFunction(prefix, localName);
}
 
開發者ID:camunda,項目名稱:camunda-engine-dmn,代碼行數:10,代碼來源:CompositeFunctionMapper.java

示例8: getValue

import javax.el.FunctionMapper; //導入方法依賴的package包/類
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }

    Class<?>[] paramTypes = m.getParameterTypes();
    Object[] params = null;
    Object result = null;
    int numParams = this.jjtGetNumChildren();
    if (numParams > 0) {
        params = new Object[numParams];
        try {
            for (int i = 0; i < numParams; i++) {
                params[i] = this.children[i].getValue(ctx);
                params[i] = coerceToType(params[i], paramTypes[i]);
            }
        } catch (ELException ele) {
            throw new ELException(MessageFactory.get("error.function", this
                    .getOutputName()), ele);
        }
    }
    try {
        result = m.invoke(null, params);
    } catch (IllegalAccessException iae) {
        throw new ELException(MessageFactory.get("error.function", this
                .getOutputName()), iae);
    } catch (InvocationTargetException ite) {
        Throwable cause = ite.getCause();
        if (cause instanceof ThreadDeath) {
            throw (ThreadDeath) cause;
        }
        if (cause instanceof VirtualMachineError) {
            throw (VirtualMachineError) cause;
        }
        throw new ELException(MessageFactory.get("error.function", this
                .getOutputName()), cause);
    }
    return result;
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:51,代碼來源:AstFunction.java

示例9: getValue

import javax.el.FunctionMapper; //導入方法依賴的package包/類
public Object getValue(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }

    Class[] paramTypes = m.getParameterTypes();
    Object[] params = null;
    Object result = null;
    int numParams = this.jjtGetNumChildren();
    if (numParams > 0) {
        params = new Object[numParams];
        try {
            for (int i = 0; i < numParams; i++) {
                params[i] = this.children[i].getValue(ctx);
                params[i] = coerceToType(params[i], paramTypes[i]);
            }
        } catch (ELException ele) {
            throw new ELException(MessageFactory.get("error.function", this
                    .getOutputName()), ele);
        }
    }
    try {
        result = m.invoke(null, params);
    } catch (IllegalAccessException iae) {
        throw new ELException(MessageFactory.get("error.function", this
                .getOutputName()), iae);
    } catch (InvocationTargetException ite) {
        throw new ELException(MessageFactory.get("error.function", this
                .getOutputName()), ite.getCause());
    }
    return result;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:43,代碼來源:AstFunction.java

示例10: getValue

import javax.el.FunctionMapper; //導入方法依賴的package包/類
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }

    Class<?>[] paramTypes = m.getParameterTypes();
    Object[] params = null;
    Object result = null;
    int numParams = this.jjtGetNumChildren();
    if (numParams > 0) {
        params = new Object[numParams];
        try {
            for (int i = 0; i < numParams; i++) {
                params[i] = this.children[i].getValue(ctx);
                params[i] = coerceToType(params[i], paramTypes[i]);
            }
        } catch (ELException ele) {
            throw new ELException(MessageFactory.get("error.function", this
                    .getOutputName()), ele);
        }
    }
    try {
        result = m.invoke(null, params);
    } catch (IllegalAccessException iae) {
        throw new ELException(MessageFactory.get("error.function", this
                .getOutputName()), iae);
    } catch (InvocationTargetException ite) {
        throw new ELException(MessageFactory.get("error.function", this
                .getOutputName()), ite.getCause());
    }
    return result;
}
 
開發者ID:WhiteBearSolutions,項目名稱:WBSAirback,代碼行數:44,代碼來源:AstFunction.java


注:本文中的javax.el.FunctionMapper.resolveFunction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。