Examples of JavaMethod


Examples of org.apache.jdo.model.java.JavaMethod

                if (descr == null) continue;
                String name = descr.getName();
                JavaType type =
                    beanClass.getJavaTypeForClass(descr.getPropertyType());
                Method getter = descr.getReadMethod();
                JavaMethod javaGetter = (getter == null) ? null :
                    beanClass.createJavaMethod(getter);
                Method setter = descr.getWriteMethod();
                JavaMethod javaSetter = (setter == null) ? null :
                    beanClass.createJavaMethod(setter);
                beanClass.createJavaProperty(name, javaGetter,
                                             javaSetter, type);
            }
        }
View Full Code Here

Examples of org.apache.muse.tools.inspector.JavaMethod

    Capability capability = null;

    Map methods = inspector.getJavaMethods();

    for (Iterator i = methods.values().iterator(); i.hasNext();) {
      JavaMethod method = (JavaMethod) i.next();
     
      capability = getCapability(method.getName(), capabilities);
           
      String actionURI = (String) _internalActionMap.get(method.getName());
      if(actionURI != null) {
        method.setActionURI(actionURI);
      }
     
      capability.addOperation(method);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.expl.JavaMethod

      Method met = methods[i];
      int mod = met.getModifiers();
      if (Modifier.isStatic(mod) && Modifier.isPublic(mod))
      {
        manager.registerFunction(namespace, met.getName(),
                                 new JavaMethod(met));
      }
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod

      }
    }
    else {
      runtimeType = pController.getRuntimeType();
    }
    JavaMethod jm = pSource.newJavaMethod(pMethodName, runtimeType, JavaSource.PUBLIC);
    if (!pSource.isInterface()) {
      jm.addLine("return " + pFieldName + ";");
    }
    return jm;
  }
View Full Code Here

Examples of org.eclipse.persistence.jaxb.javamodel.JavaMethod

            prop.setXmlPath(xpath);
            prop.setSchemaName(new QName(pname));
            // figure out the type based on transformer method return type
            JavaClass jType = null;
            JavaClass jClass = null;
            JavaMethod jMethod = null;
            String methodName;
            if (writeTransformer.isSetTransformerClass()) {
                // handle transformer class
                try {
                    jClass = helper.getJavaClass(writeTransformer.getTransformerClass());
                } catch (JAXBException x) {
                    throw JAXBException.transformerClassNotFound(writeTransformer.getTransformerClass());
                }
                methodName = BUILD_FIELD_VALUE_METHOD;
                jMethod = jClass.getDeclaredMethod(methodName, new JavaClass[] { helper.getJavaClass(Object.class), helper.getJavaClass(String.class), helper.getJavaClass(Session.class) });
                if (jMethod == null) {
                    throw JAXBException.noSuchWriteTransformationMethod(methodName);
                }
                jType = jMethod.getReturnType();
            } else {
                // handle method
                // here it is assumed that the JavaModel is aware of the TypeInfo's class, hence jClass cannot be null
                jClass = helper.getJavaClass(typeInfo.getJavaClassName());
                methodName = writeTransformer.getMethod();
                // the method can have 0 args or 1 arg (either AbstractSession or Session)
                // first check 0 arg
                jMethod = jClass.getDeclaredMethod(methodName, new JavaClass[] {});
                if (jMethod == null) {
                    // try AbstractSession
                    jMethod = jClass.getDeclaredMethod(methodName, new JavaClass[] { helper.getJavaClass(AbstractSession.class) });
                    if (jMethod == null) {
                        // try Session
                        jMethod = jClass.getDeclaredMethod(methodName, new JavaClass[] { helper.getJavaClass(Session.class) });
                        if (jMethod == null) {
                            throw JAXBException.noSuchWriteTransformationMethod(methodName);
                        }
                    }
                }
                jType = jMethod.getReturnType();
            }
            prop.setType(jType);
            props.add(prop);
        }
        addToSchemaType(typeInfo, props, compositor, type, schema);
View Full Code Here

Examples of org.jruby.internal.runtime.methods.JavaMethod

            throw error(ruby, ex, "Could not prepare method fields: " + newClass);
        } catch (NoSuchFieldException ex) {
            throw error(ruby, ex, "Could not prepare method fields: " + newClass);
        }

        DynamicMethod method_added = new JavaMethod(rubyCls.getSingletonClass(), Visibility.PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                RubyClass selfClass = (RubyClass)self;
                Ruby ruby = selfClass.getClassRuntime();
                String methodName = args[0].asJavaString();
View Full Code Here

Examples of org.jruby.internal.runtime.methods.JavaMethod

            throw error(ruby, ex, "Could not prepare method fields: " + newClass);
        } catch (NoSuchFieldException ex) {
            throw error(ruby, ex, "Could not prepare method fields: " + newClass);
        }

        DynamicMethod method_added = new JavaMethod(rubyCls.getSingletonClass(), Visibility.PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                RubyClass selfClass = (RubyClass)self;
                Ruby ruby = selfClass.getClassRuntime();
                String methodName = args[0].asJavaString();
View Full Code Here

Examples of org.jruby.internal.runtime.methods.JavaMethod

            }
        });

        RubyClass singleton = ifcJavaProxy.getSingletonClass();

        singleton.addMethod("new", new JavaMethod(singleton, Visibility.PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                assert self instanceof RubyClass : "InterfaceJavaProxy.new defined on non-class ";
                RubyClass rubyClass = (RubyClass)self;
View Full Code Here

Examples of org.jruby.javasupport.JavaMethod

    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) {
        createJavaMethods(self.getRuntime());

        int len = args.length;
        Object[] convertedArgs = new Object[len];
        JavaMethod method = (JavaMethod)findCallable(self, name, args, len);
        for (int i = 0; i < len; i++) {
            convertedArgs[i] = JavaUtil.convertArgumentToType(context, args[i], method.getParameterTypes()[i]);
        }
        return Java.java_to_ruby(self, method.invoke((JavaObject) self.dataGetStruct(), convertedArgs), Block.NULL_BLOCK);
    }
View Full Code Here

Examples of org.jruby.javasupport.JavaMethod

        return Java.java_to_ruby(self, method.invoke((JavaObject) self.dataGetStruct(), convertedArgs), Block.NULL_BLOCK);
    }

    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) {
        createJavaMethods(self.getRuntime());
        JavaMethod method = (JavaMethod)findCallableArityZero(self, name);
        return Java.java_to_ruby(self, method.invoke((JavaObject) self.dataGetStruct(), EMPTY_OBJECT_ARRAY), Block.NULL_BLOCK);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.