コード例 #1
0
 public override IEnumerator <MemberInfo> GetMemberInfos(ELContext context, object arg)
 {
     return(null);
 }
コード例 #2
0
 /// <summary>
 /// Constructs an ELContextEvent object to indicate that an ELContext has been created.
 /// </summary>
 /// <param name="source">
 ///            the ELContext that was created. </param>
 public ELContextEvent(ELContext source) : base(source)
 {
 }
コード例 #3
0
ファイル: FeelEngine.cs プロジェクト: zf321/ESS.FW.Bpm
        protected internal virtual ValueExpression TransformSimpleUnaryTests(string simpleUnaryTests, string inputName, ELContext elContext)
        {
            string juelExpression = transformToJuelExpression(simpleUnaryTests, inputName);

            try
            {
                return(expressionFactory.CreateValueExpression(elContext, juelExpression, typeof(object)));
            }
            catch (ELException e)
            {
                throw LOG.invalidExpression(simpleUnaryTests, e);
            }
        }
コード例 #4
0
        /// <summary>
        /// Evaluates the expression as an lvalue and determines if <seealso cref="setValue(ELContext, object)"/>
        /// will always fail. </summary>
        /// <param name="context"> used to resolve properties (<code>base.property</code> and <code>base[property]</code>)
        /// and to determine the result from the last base/property pair </param>
        /// <returns> <code>true</code> if <seealso cref="setValue(ELContext, object)"/> always fails. </returns>
        /// <exception cref="ELException"> if evaluation fails (e.g. property not found, type conversion failed, ...) </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public boolean isReadOnly(org.camunda.bpm.engine.impl.javax.el.ELContext context) throws org.camunda.bpm.engine.impl.javax.el.ELException
        public override bool isReadOnly(ELContext context)
        {
            return(node.isReadOnly(bindings, context));
        }
コード例 #5
0
 public override ValueReference getValueReference(ELContext context)
 {
     return(node.getValueReference(bindings, context));
 }
コード例 #6
0
 public override Type getType(Bindings bindings, ELContext context)
 {
     return(child.getType(bindings, context));
 }
コード例 #7
0
        /// <summary>
        /// Evaluates the expression as an lvalue and answers the result type. </summary>
        /// <param name="context"> used to resolve properties (<code>base.property</code> and <code>base[property]</code>)
        /// and to determine the result from the last base/property pair </param>
        /// <returns> lvalue evaluation type or <code>null</code> for rvalue expressions </returns>
        /// <exception cref="ELException"> if evaluation fails (e.g. property not found, type conversion failed, ...) </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public Class getType(org.camunda.bpm.engine.impl.javax.el.ELContext context) throws org.camunda.bpm.engine.impl.javax.el.ELException
        public override Type getType(ELContext context)
        {
            return(node.getType(bindings, context));
        }
コード例 #8
0
 public override IEnumerator <FeatureDescriptor> getFeatureDescriptors(ELContext arg0, object arg1)
 {
     return(null);
 }
コード例 #9
0
 public override Type getType(ELContext arg0, object arg1, object arg2)
 {
     return(typeof(object));
 }
コード例 #10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public Object eval(Bindings bindings, org.camunda.bpm.engine.impl.javax.el.ELContext context) throws org.camunda.bpm.engine.impl.javax.el.ELException
        public override object eval(Bindings bindings, ELContext context)
        {
            return(@operator.eval(bindings, context, child));
        }
コード例 #11
0
 public override Type getCommonPropertyType(ELContext arg0, object arg1)
 {
     return(typeof(object));
 }
コード例 #12
0
 public virtual object eval(Bindings bindings, ELContext context, AstNode node)
 {
     return(apply(bindings, node.eval(bindings, context)));
 }
コード例 #13
0
 public ExpressionGetInvocation(ValueExpression valueExpression, ELContext elContext,
                                IBaseDelegateExecution contextExecution) : base(contextExecution, null)
 {
     this._valueExpression = valueExpression;
     this._elContext       = elContext;
 }
コード例 #14
0
 public override bool isReadOnly(ELContext context, object @base, object property)
 {
     return(true);
 }
コード例 #15
0
 public override MethodInfo getMethodInfo(Bindings bindings, ELContext context, Type returnType, Type[] paramTypes)
 {
     return(child.getMethodInfo(bindings, context, returnType, paramTypes));
 }
コード例 #16
0
 public override object eval(Bindings bindings, ELContext context)
 {
     return(@operator.eval(bindings, context, left, right));
 }
コード例 #17
0
 public override object invoke(Bindings bindings, ELContext context, Type returnType, Type[] paramTypes, object[] paramValues)
 {
     return(child.invoke(bindings, context, returnType, paramTypes, paramValues));
 }
コード例 #18
0
 public virtual object eval(Bindings bindings, ELContext context, AstNode left, AstNode right)
 {
     return(apply(bindings, left.eval(bindings, context), right.eval(bindings, context)));
 }
コード例 #19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="valueExpression"></param>
 /// <param name="elContext"></param>
 public ExpressionGetInvocation(ValueExpression valueExpression, ELContext elContext) : base(valueExpression)
 {
     this.elContext = elContext;
 }
コード例 #20
0
            public object eval(Bindings bindings, ELContext context, AstNode left, AstNode right)
            {
                bool?l = bindings.convert(left.eval(bindings, context), typeof(Boolean));

                return(true.Equals(l) ? bindings.convert(right.eval(bindings, context), typeof(Boolean)) : false);
            }
コード例 #21
0
        /// <summary>
        /// Evaluates the expression as an rvalue and answers the result. </summary>
        /// <param name="context"> used to resolve properties (<code>base.property</code> and <code>base[property]</code>)
        /// and to determine the result from the last base/property pair </param>
        /// <returns> rvalue evaluation result </returns>
        /// <exception cref="ELException"> if evaluation fails (e.g. property not found, type conversion failed, ...) </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public Object getValue(org.camunda.bpm.engine.impl.javax.el.ELContext context) throws org.camunda.bpm.engine.impl.javax.el.ELException
        public override object getValue(ELContext context)
        {
            return(node.getValue(bindings, context, type));
        }
コード例 #22
0
 public override bool isReadOnly(Bindings bindings, ELContext context)
 {
     return(child.isReadOnly(bindings, context));
 }
コード例 #23
0
        /// <summary>
        /// Evaluates the expression as an lvalue and assigns the given value. </summary>
        /// <param name="context"> used to resolve properties (<code>base.property</code> and <code>base[property]</code>)
        /// and to perform the assignment to the last base/property pair </param>
        /// <exception cref="ELException"> if evaluation fails (e.g. property not found, type conversion failed, assignment failed...) </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void setValue(org.camunda.bpm.engine.impl.javax.el.ELContext context, Object value) throws org.camunda.bpm.engine.impl.javax.el.ELException
        public override void setValue(ELContext context, object value)
        {
            node.setValue(bindings, context, value);
        }
コード例 #24
0
 public override void setValue(Bindings bindings, ELContext context, object value)
 {
     child.setValue(bindings, context, value);
 }
コード例 #25
0
        public override object Eval(Bindings bindings, ELContext context)
        {
            bool?value = bindings.Convert <bool>(question.Eval(bindings, context), typeof(Boolean));

            return(value.Value ? yes.Eval(bindings, context) : no.Eval(bindings, context));
        }
コード例 #26
0
 public override ValueReference getValueReference(Bindings bindings, ELContext context)
 {
     return(child.getValueReference(bindings, context));
 }
コード例 #27
0
 //   private readonly ELContext context;
 public CompRepository(ELContext context) : base(context)
 {
 }
コード例 #28
0
 public override object eval(Bindings bindings, ELContext context)
 {
     return(child.eval(bindings, context));
 }
コード例 #29
0
        /// <summary>
        /// Invoke method. </summary>
        /// <param name="bindings"> </param>
        /// <param name="context"> </param>
        /// <param name="base"> </param>
        /// <param name="method"> </param>
        /// <returns> method result </returns>
        /// <exception cref="InvocationTargetException"> </exception>
        /// <exception cref="IllegalAccessException"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected Object invoke(Bindings bindings, org.camunda.bpm.engine.impl.javax.el.ELContext context, Object super, Method method) throws InvocationTargetException, IllegalAccessException
        protected internal virtual object invoke(Bindings bindings, ELContext context, object @base, System.Reflection.MethodInfo method)
        {
            Type[]   types   = method.ParameterTypes;
            object[] @params = null;
            if (types.Length > 0)
            {
                @params = new object[types.Length];
                if (varargs && method.VarArgs)
                {
                    for (int i = 0; i < @params.Length - 1; i++)
                    {
                        object param = getParam(i).eval(bindings, context);
                        if (param != null || types[i].IsPrimitive)
                        {
                            @params[i] = bindings.convert(param, types[i]);
                        }
                    }
                    int    varargIndex = types.Length - 1;
                    Type   varargType  = types[varargIndex].GetElementType();
                    int    length      = ParamCount - varargIndex;
                    object array       = null;
                    if (length == 1)
                    {                     // special: eventually use argument as is
                        object param = getParam(varargIndex).eval(bindings, context);
                        if (param != null && param.GetType().IsArray)
                        {
                            if (types[varargIndex].IsInstanceOfType(param))
                            {
                                array = param;
                            }
                            else
                            {                             // coerce array elements
                                length = Array.getLength(param);
                                array  = Array.CreateInstance(varargType, length);
                                for (int i = 0; i < length; i++)
                                {
                                    object elem = Array.get(param, i);
                                    if (elem != null || varargType.IsPrimitive)
                                    {
                                        ((Array)array).SetValue(bindings.convert(elem, varargType), i);
                                    }
                                }
                            }
                        }
                        else
                        {                         // single element array
                            array = Array.CreateInstance(varargType, 1);
                            if (param != null || varargType.IsPrimitive)
                            {
                                ((Array)array).SetValue(bindings.convert(param, varargType), 0);
                            }
                        }
                    }
                    else
                    {
                        array = Array.CreateInstance(varargType, length);
                        for (int i = 0; i < length; i++)
                        {
                            object param = getParam(varargIndex + i).eval(bindings, context);
                            if (param != null || varargType.IsPrimitive)
                            {
                                ((Array)array).SetValue(bindings.convert(param, varargType), i);
                            }
                        }
                    }
                    @params[varargIndex] = array;
                }
                else
                {
                    for (int i = 0; i < @params.Length; i++)
                    {
                        object param = getParam(i).eval(bindings, context);
                        if (param != null || types[i].IsPrimitive)
                        {
                            @params[i] = bindings.convert(param, types[i]);
                        }
                    }
                }
            }
            return(method.invoke(@base, @params));
        }
コード例 #30
0
 public override Type GetCommonPropertyType(ELContext context, object arg)
 {
     return(typeof(object));
 }