//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public org.boris.expr.Expr evaluateVariable(org.boris.expr.ExprVariable paramExprVariable) throws org.boris.expr.ExprException public virtual Expr evaluateVariable(ExprVariable paramExprVariable) { if (hasAdditionalVariable(paramExprVariable.Name.ToUpper())) { return(getAdditionalVariableValue(paramExprVariable.Name.ToUpper())); } if (this.variableMap.ContainsKey(paramExprVariable.Name.ToUpper())) { FunctionArgumentTable functionArgumentTable = (FunctionArgumentTable)this.variableMap[paramExprVariable.Name.ToUpper()]; return(expressionFromVariable(functionArgumentTable, paramExprVariable)); } throw new ExprException("Variable " + paramExprVariable + " not found"); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void annotateVariable(org.boris.expr.ExprVariable paramExprVariable) throws org.boris.expr.ExprException public virtual void annotateVariable(ExprVariable paramExprVariable) { if (this.refArgsIns != null) { if (this.variableMap.ContainsKey(paramExprVariable.Name.ToUpper())) { FunctionArgumentTable functionArgumentTable = (FunctionArgumentTable)this.variableMap[paramExprVariable.Name.ToUpper()]; if (!this.refArgsIns.Contains(functionArgumentTable)) { this.refArgsIns.Add(functionArgumentTable); } } } else if (!this.variableMap.ContainsKey(paramExprVariable.Name.ToUpper())) { throw new ExprException("Variable " + paramExprVariable + " not found"); } }
public ExprWithDefinition(FunctionArgumentTable paramFunctionArgumentTable, ExprDefinition paramExprDefinition) { this.functionArgument = paramFunctionArgumentTable; this.definition = paramExprDefinition; }
private Expr expressionFromVariable(FunctionArgumentTable paramFunctionArgumentTable, ExprVariable paramExprVariable) { if (paramFunctionArgumentTable.Type.Equals("datatype.decimal")) { return(StringUtils.isDecimal(paramFunctionArgumentTable.DefaultValue) ? new ExprDouble(double.Parse(paramFunctionArgumentTable.DefaultValue)) : new ExprDouble(1.5D)); } if (paramFunctionArgumentTable.Type.Equals("datatype.takeoff")) { return(StringUtils.isDecimal(paramFunctionArgumentTable.DefaultValue) ? new ExprDouble(double.Parse(paramFunctionArgumentTable.DefaultValue)) : new ExprDouble(1.5D)); } if (paramFunctionArgumentTable.Type.Equals("datatype.integer")) { return(StringUtils.isInteger(paramFunctionArgumentTable.DefaultValue) ? new ExprInteger(int.Parse(paramFunctionArgumentTable.DefaultValue)) : new ExprInteger(1)); } if (paramFunctionArgumentTable.Type.Equals("datatype.list")) { if (!StringUtils.isNullOrBlank(paramFunctionArgumentTable.DefaultValue)) { return(new ExprString(paramFunctionArgumentTable.DefaultValue)); } string str = StringUtils.getFirstLine(paramFunctionArgumentTable.SelectionList); return(!StringUtils.isNullOrBlank(str) ? new ExprString(str) : new ExprString(paramExprVariable.Name)); } if (paramFunctionArgumentTable.Type.Equals("datatype.country")) { return(new ExprString("US")); } if (paramFunctionArgumentTable.Type.Equals("datatype.image")) { return(new ExprString("")); } if (paramFunctionArgumentTable.Type.Equals("datatype.notes")) { return(!StringUtils.isNullOrBlank(paramFunctionArgumentTable.DefaultValue) ? new ExprString(paramFunctionArgumentTable.DefaultValue) : new ExprString("")); } if (paramFunctionArgumentTable.Type.Equals("datatype.array")) { return(new DummyExprArray()); } if (paramFunctionArgumentTable.Type.Equals("datatype.text")) { return(!StringUtils.isNullOrBlank(paramFunctionArgumentTable.DefaultValue) ? new ExprString(paramFunctionArgumentTable.DefaultValue) : new ExprString("")); } if (paramFunctionArgumentTable.Type.Equals("datatype.locfactor")) { return(new ExprLocation("US")); } if (paramFunctionArgumentTable.Type.Equals("datatype.calcvalue")) { return(new ExprDouble(1.5D)); } if (paramFunctionArgumentTable.Type.Equals("datatype.date")) { return(new ExprDouble(1.5D)); } if (paramFunctionArgumentTable.Type.Equals("datatype.boolean")) { return(StringUtils.isBoolean(paramFunctionArgumentTable.DefaultValue) ? new ExprBoolean(bool.Parse(paramFunctionArgumentTable.DefaultValue)) : new ExprBoolean(true)); } Console.WriteLine("oops return variable cause type is: " + paramFunctionArgumentTable.Type); paramExprVariable.Name = paramExprVariable.Name.ToUpper(); return(paramExprVariable); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private org.boris.expr.Expr evaluateConstant(ExprAbstractEvaluationContext paramExprAbstractEvaluationContext, nomitech.common.db.local.FunctionArgumentTable paramFunctionArgumentTable) throws org.boris.expr.ExprException private Expr evaluateConstant(ExprAbstractEvaluationContext paramExprAbstractEvaluationContext, FunctionArgumentTable paramFunctionArgumentTable) { if (paramFunctionArgumentTable.Type.Equals("datatype.image")) { return(new ExprString(paramFunctionArgumentTable.DefaultValue)); } if (paramFunctionArgumentTable.Type.Equals("datatype.calcvalue")) { try { return(new ExprDouble((new double?(paramFunctionArgumentTable.ValidationStatement)))); } catch (Exception) { } } Expr expr = paramExprAbstractEvaluationContext.parseStatement(paramFunctionArgumentTable.ValidationStatement); if (paramFunctionArgumentTable.Type.Equals("datatype.calcvalue") && !(expr is org.boris.expr.ExprNumber) && !(expr is ExprString)) { throw new ExprException("Function " + this.fTable.Name + " has constant " + paramFunctionArgumentTable.Name + " that does not return a Number or Text"); } return(expr); }