Examples of addMethod()


Examples of alt.jiapi.reflect.JiapiClass.addMethod()

    static byte[] jiapiHelloWorld() throws MethodExistsException {
        JiapiClass c = JiapiClass.createClass("HelloWorld");

        // No API to set SourceFile!

        JiapiMethod method = c.addMethod(Modifier.PUBLIC, "<init>", emptySig);
        InstructionList il = method.getInstructionList();
        InstructionFactory iFactory = il.getInstructionFactory();
        il.add(iFactory.aload(0));
        il.add(iFactory.invoke(0, "java/lang/Object", "<init>", emptySig));
        il.add(iFactory.returnMethod(method));
View Full Code Here

Examples of by.stub.yaml.stubs.StubRequest.addMethod()

public class ReflectionUtilsTest {

   @Test
   public void shouldGetObjectPropertiesAndValues() throws Exception {
      final StubRequest stubRequest = StubRequest.newStubRequest();
      stubRequest.addMethod(HttpMethods.POST);
      final Map<String, String> properties = ReflectionUtils.getProperties(stubRequest);

      assertThat("[POST]").isEqualTo(properties.get("method"));
      assertThat(properties.get("url")).isNull();
      assertThat(properties.get("post")).isNull();
View Full Code Here

Examples of cn.shenyanchao.ut.builder.ClassTypeBuilder.addMethod()

                    methodDeclaration);
            boolean methodExist = (testMethodDeclaration == null ? false : true);
            if (!methodExist) {
                classTypeBuilder.buildMethod(methodName + Consts.TEST_SUFFIX, methodDeclaration);
            } else if (methodExist) {
                classTypeBuilder.addMethod(testMethodDeclaration);
            }
        }
        compilationUnitBuilder.buildClass(classTypeBuilder.build());
        return compilationUnitBuilder;
    }
View Full Code Here

Examples of com.alibaba.citrus.util.internal.StaticFunctionDelegatorBuilder.addMethod()

            for (MethodInfo methodInfo : mixinMethods) {
                for (Method method : methodInfo.containingClass.getMethods()) {
                    String methodName = method.getName();

                    if (methodName.equals(methodInfo.methodName)) {
                        builder.addMethod(method, methodInfo.rename);
                    }
                }
            }
        }
View Full Code Here

Examples of com.alibaba.dubbo.common.bytecode.ClassGenerator.addMethod()

                    code.append("arg").append(i);
                }
                code.append(");");
            }
           
            cg.addMethod(method.getName(), method.getModifiers(), rt, pts,
                    method.getExceptionTypes(), code.toString());
        }
        return cg.toClass();
    }
View Full Code Here

Examples of com.caucho.config.types.CustomBeanConfig.addMethod()

  public void setValue(Object bean, QName name, Object value)
    throws ConfigException
  {
    CustomBeanConfig customBean = (CustomBeanConfig) bean;

    customBean.addMethod((CustomBeanMethodConfig) value);
  }
 
  /**
   * Sets the value of the attribute
   */
 
View Full Code Here

Examples of com.claritysys.jvm.classfile.ClassFile.addMethod()

        ClassFile cf = new ClassFile("HelloWorld",
                "java/lang/Object",
                "HelloWorld.java");
        ConstantPool cp = cf.getConstantPool();

        CfMethod method = cf.addMethod(JVM.ACC_PUBLIC, "<init>", "()V");
        CodeBuilder code = new CodeBuilder(method);
        code.add(JVM.ALOAD_0);
        code.add(JVM.INVOKESPECIAL, cp.addMethodRef(false,
                "java/lang/Object",
                "<init>",
View Full Code Here

Examples of com.dragome.compiler.ast.TypeDeclaration.addMethod()

        if (!signature.toString().equals(singleSignature))
          continue;
      }

      MethodDeclaration methodDecl= new MethodDeclaration(binding, method.getAccessFlags(), method.getCode(), methodAnnotationsValues);
      typeDecl.addMethod(methodDecl);

      parseMethod(typeDecl, methodDecl, method);
    }

    return typeDecl;
View Full Code Here

Examples of com.facebook.swift.generator.template.ServiceContext.addMethod()

        final Service service = Service.class.cast(visitable);
        final ServiceContext serviceContext = contextGenerator.serviceFromThrift(service);

        for (ThriftMethod method: service.getMethods()) {
            final MethodContext methodContext = contextGenerator.methodFromThrift(method);
            serviceContext.addMethod(methodContext);

            for (final ThriftField field : method.getArguments()) {
                methodContext.addParameter(contextGenerator.fieldFromThrift(field));
            }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassType.addMethod()

  private static JClassType createInstantiableClassType(String typeBinaryName) {
    JClassType instantiableType = new JClassType(SourceOrigin.UNKNOWN, typeBinaryName, false, true);
    JConstructor defaultConstructor = new JConstructor(SourceOrigin.UNKNOWN, instantiableType);
    defaultConstructor.setOriginalTypes(instantiableType, Lists.<JType>newArrayList());
    instantiableType.addMethod(defaultConstructor);
    return instantiableType;
  }

  private MockLibraryJavaToJavaScriptCompiler compiler;
  private CompilerContext compilerContext;
View Full Code Here
TOP
Copyright © 2015 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.