Exemplo n.º 1
0
 public override global::System.Object getParameterTypes()
 {
     org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                    java.lang.reflect.Method._nImpl> adapter
         = (org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                           java.lang.reflect.Method._nImpl>) this._faddress;
     global::System.Reflection.MethodInfo      nativeMethodInfo     = adapter.getMemberInfoAdaptee();
     global::System.Reflection.ParameterInfo[] nativeParameterInfos = nativeMethodInfo.GetParameters();
     java.lang.Class[] parameterJavaTypes = new java.lang.Class[nativeParameterInfos.Length];
     for (int i = 0; i < nativeParameterInfos.Length; i++)
     {
         global::System.Type parameterNativeType = nativeParameterInfos[i].ParameterType;
         parameterJavaTypes[i] = org.xmlvm._nTIB.getClass(parameterNativeType);
     }
     org.xmlvm._nArrayAdapter <object> result = new org.xmlvm._nArrayAdapter <object>(parameterJavaTypes);
     return(result);
 }
Exemplo n.º 2
0
            public override global::System.Object invoke(java.lang.Object n1, org.xmlvm._nArrayAdapter <global::System.Object> n2)
            {
                org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                               java.lang.reflect.Method._nImpl> adapter
                    = (org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                                      java.lang.reflect.Method._nImpl>) this._faddress;
                global::System.Reflection.MethodInfo      nativeMethodInfo     = adapter.getMemberInfoAdaptee();
                global::System.Reflection.ParameterInfo[] nativeParameterInfos = nativeMethodInfo.GetParameters();
                object[] methodNativeParameters = n2.getCSharpArray();
                for (int i = 0; i < methodNativeParameters.Length; i++)
                {
                    methodNativeParameters[i]
                        = org.xmlvm._nTIB.unboxIfPrimitive((java.lang.Object)methodNativeParameters[i], nativeParameterInfos[i].ParameterType);
                }
                object returnValue = nativeMethodInfo.Invoke(n1, methodNativeParameters);

                returnValue = org.xmlvm._nTIB.boxIfPrimitive(returnValue, nativeMethodInfo.ReturnType);
                return(returnValue);
            }
Exemplo n.º 3
0
            public override global::System.Object newInstance(org.xmlvm._nArrayAdapter <global::System.Object> n1)
            {
                org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                               java.lang.reflect.Constructor._nImpl> adapter
                    = (org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                                      java.lang.reflect.Constructor._nImpl>) this._faddress;
                global::System.Reflection.MethodInfo jConstructorInfo = adapter.getMemberInfoAdaptee();
                global::System.Type nativeType = jConstructorInfo.DeclaringType;
                object resultObj = global::System.Activator.CreateInstance(nativeType);

                object[] jConstructorParameters = n1.getCSharpArray();
                global::System.Reflection.ParameterInfo[] parameterInfos = jConstructorInfo.GetParameters();
                for (int i = 0; i < jConstructorParameters.Length; i++)
                {
                    jConstructorParameters[i]
                        = org.xmlvm._nTIB.unboxIfPrimitive((java.lang.Object)jConstructorParameters[i], parameterInfos[i].ParameterType);
                }
                jConstructorInfo.Invoke(resultObj, jConstructorParameters);
                return(resultObj);
            }