通过MVEL来解析表达式的值，如果出错不抛出异常.
@param exp 待解析表达式
@param paramObj 参数对象
@return 返回解析后的值
424313
public static Object parseExpress(String exp, Object paramObj) {
        try {
            return MVEL.eval(exp, paramObj);
        } catch (Exception e) {
            log.error("解析表达式出错,表达式为:" + exp, e);
            return null;
        }
    }
395471
public final void mEXP() throws RecognitionException {
        try {
            int _type = EXP;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // com/dyuproject/protostuff/parser/ProtoLexer.g:235:5: ( NUMINT ( 'e' | 'E' ) NUMINT )
            // com/dyuproject/protostuff/parser/ProtoLexer.g:235:9: NUMINT ( 'e' | 'E' ) NUMINT
            {
            mNUMINT(); 
            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
                input.consume();

            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;}

            mNUMINT(); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
212162
public static String getRemoteUrlParameter(String urlPrefix, String app, String version, String env, String key,
                                               DisConfigTypeEnum disConfigTypeEnum) {

        Map<String, String> parameterMap = getConfServerBasePathMap(app, version, env, key);

        // 配置文件或配置项
        parameterMap.put(Constants.TYPE, String.valueOf(disConfigTypeEnum.getType()));

        StringBuffer sb = new StringBuffer();
        sb.append(urlPrefix);

        if (disConfigTypeEnum.getType() == DisConfigTypeEnum.FILE.getType()) {
            sb.append(Constants.SEP_STRING + Constants.STORE_FILE_URL_KEY);
        } else {
            sb.append(Constants.SEP_STRING + Constants.STORE_ITEM_URL_KEY);
        }

        sb.append("?");
        for (String thisKey : parameterMap.keySet()) {

            String cur = thisKey + "=" + parameterMap.get(thisKey);
            cur += "&";
            sb.append(cur);
        }

        if (sb.length() > 0) {
            sb.deleteCharAt(sb.length() - 1);
        }

        return sb.toString();
    }
1011107
public Method getJavaMethod(Class<?> clazz, String methodName, Class... parameterTypes) {
        String clazzName = clazz.getName();
        String methodKey = buildMethodKey(clazzName, methodName, parameterTypes);

        Method method = methodCache.get(methodKey);
        if (null == method) {
            getFastClass(clazz);// 分析一次clazz,这时会跟新methodCache
            return methodCache.get(methodKey);
        } else {
            return method;
        }
    }
834786
public JvmOperation getJvmOperation(IMethod method, XtendTypeDeclaration context)
			throws JavaModelException {
		if (!method.isConstructor() && !method.isLambdaMethod() && !method.isMainMethod()) {
			final JvmType type = this.typeReferences.findDeclaredType(
					method.getDeclaringType().getFullyQualifiedName(),
					context);
			return getJvmOperation(method, type);
		}
		return null;
	}
526613
public String getParameterByReflection(Object obj, String param)
    {
        Object value = null;
        try {
            java.lang.reflect.Method method = obj.getClass().getMethod("getParameter", String.class);
            
            if (method != null)
                value = method.invoke(obj, param);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (value == null)
            return null;
        else
            return value.toString();
    }
315499
private static SqlInfo buildFinalSql(SqlInfo sqlInfo, Object paramObj) {
        // 得到生成的SQL，如果有MVEL的模板表达式，则执行计算出该表达式来生成最终的SQL
        String sql = sqlInfo.getJoin().toString();
        sql = ParseHelper.parseTemplate(sql, paramObj);
        return sqlInfo.setSql(StringHelper.replaceBlank(sql));
    }
1013031
private static void createIf(MethodVisitor mv, Method method, Label next, Label start,
                                 String className, Class<?> parentClass) {
        // 标记分支开始位置
        mv.visitLabel(start);
        mv.visitFrame(F_SAME, 0, null, 0, null);
        // 比较方法声明类
        stringEquals(mv, () -> mv.visitVarInsn(ALOAD, 1), convert(method.getDeclaringClass()), next,
            () -> {
                // 比较方法名
                stringEquals(mv, () -> mv.visitVarInsn(ALOAD, 2), method.getName(), next, () -> {
                    // 方法名一致再比较方法说明
                    stringEquals(mv, () -> mv.visitVarInsn(ALOAD, 3),
                        ByteCodeUtils.getMethodDesc(method), next, () -> {
                            // 方法说明也一致后执行方法
                            invokeMethod(mv, method, () -> {
                                // 调用代理对象对应的方法而不是本代理的方法
                                mv.visitVarInsn(ALOAD, 0);
                                mv.visitFieldInsn(GETFIELD, convert(className), TARGET_FIELD_NAME,
                                    getByteCodeType(parentClass));
                                // 获取参数数量，用于载入参数
                                int count = method.getParameterCount();
                                Class<?>[] types = method.getParameterTypes();

                                // 循环载入参数
                                for (int i = 0; i < count; i++) {
                                    mv.visitVarInsn(Opcodes.ALOAD, 4);
                                    // 这里注意，访问数组下标0-5和6-无穷是不一样的
                                    // 访问0-5对应的byte code：  aload | iconst_[0-5] | aaload
                                    // 访问下标大于5的byte code: aload | bipush [6-无穷] aaload
                                    if (i <= 5) {
                                        mv.visitInsn(ICONST_0 + i);
                                    } else {
                                        mv.visitIntInsn(BIPUSH, i);
                                    }
                                    mv.visitInsn(Opcodes.AALOAD);
                                    mv.visitTypeInsn(CHECKCAST, convert(types[i]));
                                }
                            });
                        });
                });
            });
    }
831036
function parseTmpl(tmpl, paramObj) {
    paramObj = paramObj || paramObj;

    if (typeof tmpl === 'string') {
        return tmpl.replace(/\$([_a-zA-Z0-9]*)\$/g, function (m, n) {
            return typeof paramObj[n] === 'undefined' ? '' : paramObj[n];
        });
    } else {
        return tmpl;
    }
}
1274365
public static String getMapParamOrEmpty(Map<String,String[]> map, 
			String param) {
		String val = getMapParam(map, param);
		return (val == null) ? "" : val;
	}
795000
ConstructorParamExpressionBuilder param() {
    return new ConstructorParamExpressionBuilder(
        new ExpressionHandler<ConstructorCallBuilder>() {
          public ConstructorCallBuilder handleExpression(Expression e) {
            return new ConstructorCallBuilder(
                factory,
                expressionHandler,
                parameters.append(e));
          }
    });
  }
1223501
public final EObject ruleFullJvmFormalParameter() throws RecognitionException {
        EObject current = null;

        Token lv_extension_0_0=null;
        Token otherlv_2=null;
        AntlrDatatypeRuleToken lv_name_1_0 = null;

        EObject lv_parameterType_3_0 = null;



        	enterRule();

        try {
            // InternalSARL.g:8264:2: ( ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) otherlv_2= ':' ( (lv_parameterType_3_0= ruleMultiTypeReference ) ) ) )
            // InternalSARL.g:8265:2: ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) otherlv_2= ':' ( (lv_parameterType_3_0= ruleMultiTypeReference ) ) )
            {
            // InternalSARL.g:8265:2: ( ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) otherlv_2= ':' ( (lv_parameterType_3_0= ruleMultiTypeReference ) ) )
            // InternalSARL.g:8266:3: ( (lv_extension_0_0= 'extension' ) )? ( (lv_name_1_0= ruleValidID ) ) otherlv_2= ':' ( (lv_parameterType_3_0= ruleMultiTypeReference ) )
            {
            // InternalSARL.g:8266:3: ( (lv_extension_0_0= 'extension' ) )?
            int alt227=2;
            int LA227_0 = input.LA(1);

            if ( (LA227_0==45) ) {
                alt227=1;
            }
            switch (alt227) {
                case 1 :
                    // InternalSARL.g:8267:4: (lv_extension_0_0= 'extension' )
                    {
                    // InternalSARL.g:8267:4: (lv_extension_0_0= 'extension' )
                    // InternalSARL.g:8268:5: lv_extension_0_0= 'extension'
                    {
                    lv_extension_0_0=(Token)match(input,45,FOLLOW_3); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      					newLeafNode(lv_extension_0_0, grammarAccess.getFullJvmFormalParameterAccess().getExtensionExtensionKeyword_0_0());
                      				
                    }
                    if ( state.backtracking==0 ) {

                      					if (current==null) {
                      						current = createModelElement(grammarAccess.getFullJvmFormalParameterRule());
                      					}
                      					setWithLastConsumed(current, "extension", true, "extension");
                      				
                    }

                    }


                    }
                    break;

            }

            // InternalSARL.g:8280:3: ( (lv_name_1_0= ruleValidID ) )
            // InternalSARL.g:8281:4: (lv_name_1_0= ruleValidID )
            {
            // InternalSARL.g:8281:4: (lv_name_1_0= ruleValidID )
            // InternalSARL.g:8282:5: lv_name_1_0= ruleValidID
            {
            if ( state.backtracking==0 ) {

              					newCompositeNode(grammarAccess.getFullJvmFormalParameterAccess().getNameValidIDParserRuleCall_1_0());
              				
            }
            pushFollow(FOLLOW_40);
            lv_name_1_0=ruleValidID();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {

              					if (current==null) {
              						current = createModelElementForParent(grammarAccess.getFullJvmFormalParameterRule());
              					}
              					set(
              						current,
              						"name",
              						lv_name_1_0,
              						"org.eclipse.xtend.core.Xtend.ValidID");
              					afterParserOrEnumRuleCall();
              				
            }

            }


            }

            otherlv_2=(Token)match(input,46,FOLLOW_41); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			newLeafNode(otherlv_2, grammarAccess.getFullJvmFormalParameterAccess().getColonKeyword_2());
              		
            }
            // InternalSARL.g:8303:3: ( (lv_parameterType_3_0= ruleMultiTypeReference ) )
            // InternalSARL.g:8304:4: (lv_parameterType_3_0= ruleMultiTypeReference )
            {
            // InternalSARL.g:8304:4: (lv_parameterType_3_0= ruleMultiTypeReference )
            // InternalSARL.g:8305:5: lv_parameterType_3_0= ruleMultiTypeReference
            {
            if ( state.backtracking==0 ) {

              					newCompositeNode(grammarAccess.getFullJvmFormalParameterAccess().getParameterTypeMultiTypeReferenceParserRuleCall_3_0());
              				
            }
            pushFollow(FOLLOW_2);
            lv_parameterType_3_0=ruleMultiTypeReference();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {

              					if (current==null) {
              						current = createModelElementForParent(grammarAccess.getFullJvmFormalParameterRule());
              					}
              					set(
              						current,
              						"parameterType",
              						lv_parameterType_3_0,
              						"org.eclipse.xtend.core.Xtend.MultiTypeReference");
              					afterParserOrEnumRuleCall();
              				
            }

            }


            }


            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
984596
public static OmsEpanetParametersOptions createFromMap( HashMap<OptionParameterCodes, String> options ) throws Exception {
        OmsEpanetParametersOptions epOptions = new OmsEpanetParametersOptions();
        String units = options.get(OptionParameterCodes.UNITS);
        epOptions.units = units;
        String headloss = options.get(OptionParameterCodes.HEADLOSS);
        epOptions.headloss = headloss;
        String quality = options.get(OptionParameterCodes.QUALITY);
        epOptions.quality = quality;
        String viscosity = options.get(OptionParameterCodes.VISCOSITY);
        epOptions.viscosity = NumericsUtilities.isNumber(viscosity, Double.class);
        String diffusivity = options.get(OptionParameterCodes.DIFFUSIVITY);
        epOptions.diffusivity = NumericsUtilities.isNumber(diffusivity, Double.class);
        String specGravity = options.get(OptionParameterCodes.SPECIFICGRAVITY);
        epOptions.specificGravity = NumericsUtilities.isNumber(specGravity, Double.class);
        String trials = options.get(OptionParameterCodes.TRIALS);
        epOptions.trials = NumericsUtilities.isNumber(trials, Integer.class);
        String accuracy = options.get(OptionParameterCodes.ACCURACY);
        epOptions.accuracy = NumericsUtilities.isNumber(accuracy, Double.class);
        String unbalanced = options.get(OptionParameterCodes.UNBALANCED);
        epOptions.unbalanced = unbalanced;
        String pattern = options.get(OptionParameterCodes.PATTERN);
        epOptions.pattern = NumericsUtilities.isNumber(pattern, Integer.class);
        String demandMultiplier = options.get(OptionParameterCodes.DEMANDMULTIPLIER);
        epOptions.demandMultiplier = NumericsUtilities.isNumber(demandMultiplier, Double.class);
        String emitterExp = options.get(OptionParameterCodes.EMITEXPON);
        epOptions.emitterExponent = NumericsUtilities.isNumber(emitterExp, Double.class);
        String tolerance = options.get(OptionParameterCodes.TOLERANCE);
        epOptions.tolerance = NumericsUtilities.isNumber(tolerance, Double.class);
        epOptions.process();
        return epOptions;
    }
55829
private static Object getParam(final Object param) {
		final StringBuilder sb = new StringBuilder();
		if(param instanceof String){
			sb.append("'");
			sb.append((String)param);
			sb.append("'");
		}
		else if(param instanceof Boolean){
			sb.append(String.valueOf((Boolean)param));			
		}
        else if(param instanceof Integer){
            sb.append(String.valueOf((Integer)param));
        }
        else if(param instanceof DBRegExp){
            sb.append('/');
            sb.append(((DBRegExp) param).toString());
            sb.append('/');
        }
		
		return sb.toString();
	}
1216071
public static <T> BaseDTO<T> exec(Callable<BaseDTO<T>> callable, String msg, Object... param) {
        try {
            log.info("函数调用");
            BaseDTO<T> dto = callable.call();
            log.info("函数调用结果为：[{}]", dto);
            return dto;
        } catch (Exception e) {
            if (param == null || param.length == 0) {
                log.error(msg, e);
            } else {
                Object[] params = new Object[param.length + 1];
                System.arraycopy(param, 0, params, 0, param.length);
                params[param.length] = e;
                log.error(msg, params);
            }
            return BaseDTO.buildError();
        }
    }
796860
private void ifNotEqJmp(MethodVisitor mv, int param, int value, Label label) {
		mv.visitVarInsn(ILOAD, param);
		if (value == 0) {
			/* notest forvalue 0 */
			mv.visitJumpInsn(IFNE, label);
		} else if (value == 1) {
			mv.visitInsn(ICONST_1);
			mv.visitJumpInsn(IF_ICMPNE, label);
		} else if (value == 2) {
			mv.visitInsn(ICONST_2);
			mv.visitJumpInsn(IF_ICMPNE, label);
		} else if (value == 3) {
			mv.visitInsn(ICONST_3);
			mv.visitJumpInsn(IF_ICMPNE, label);
		} else if (value == 4) {
			mv.visitInsn(ICONST_4);
			mv.visitJumpInsn(IF_ICMPNE, label);
		} else if (value == 5) {
			mv.visitInsn(ICONST_5);
			mv.visitJumpInsn(IF_ICMPNE, label);
		} else if (value >= 6) {
			mv.visitIntInsn(BIPUSH, value);
			mv.visitJumpInsn(IF_ICMPNE, label);
		} else {
			throw new RuntimeException("non supported negative values");
		}
	}
739419
public static Object getValue(Expression exp, Class clazz, KunderaQuery kunderaQuery)
    {
        if (StringLiteral.class.isAssignableFrom(exp.getClass()))
        {
            return ((StringLiteral) exp).getUnquotedText();

        }
        else if (NumericLiteral.class.isAssignableFrom(exp.getClass()))
        {
            return PropertyAccessorFactory.getPropertyAccessor(clazz).fromString(clazz,
                    ((NumericLiteral) exp).getText());
        }
        else if (InputParameter.class.isAssignableFrom(exp.getClass()))
        {
            InputParameter ip = (InputParameter) exp;
            if (kunderaQuery.getParametersMap().containsKey(ip.getParameter()))
            {
                return kunderaQuery.getParametersMap().get(ip.getParameter());
            }
            else
            {
                return ip.getParameter();
            }
        }
        else if (KeywordExpression.class.isAssignableFrom(exp.getClass()))
        {
            KeywordExpression keyWordExp = (KeywordExpression) exp;
            return PropertyAccessorFactory.getPropertyAccessor(clazz).fromString(clazz,
                    keyWordExp.getActualIdentifier());
        }
        else if (IdentificationVariable.class.isAssignableFrom(exp.getClass()))
        {
            IdentificationVariable idvExp = (IdentificationVariable) exp;
            return idvExp.getText();
        }
        else
        {
            logger.warn("Arithmetic expression is not supported ");
            throw new KunderaException("Arithmetic expression is not supported currently");
        }
    }