Package net.sourceforge.javautil.bytecode.api.type.method

Examples of net.sourceforge.javautil.bytecode.api.type.method.BytecodeMethodConcrete


    }
   
    final BytecodeEmbedded cinit = this.getClassInitializer();
   
    if (cinit != null || this.defaultStaticValues.size() > 0) {
      BytecodeMethodConcrete clinit = new BytecodeMethodConcrete(this, "<clinit>", new TypeMemberAccess(Scope.Private, false, true, true),
        new MethodDescriptor(false, void.class, new Class[0], new Class[0]));
     
      clinit.setMethodBody(new BytecodeBlock() {
       
        @Override protected void writeInstructions(BytecodeContextMethod context) {
          for (String name : defaultStaticValues.keySet()) {
            context.set(context.getStaticField(name), defaultStaticValues.get(name));
          }
View Full Code Here


  public BytecodeMethodConcrete addMethod (String name, Scope scope, boolean isStatic, boolean isFinal, MethodDescriptor descriptor) {
    return this.addMethod(name, new TypeMemberAccess(scope, false, isStatic, isFinal), descriptor);
  }
 
  public BytecodeMethodConcrete addMethod (String name, TypeMemberAccess access, MethodDescriptor descriptor) {
    BytecodeMethodConcrete method = new BytecodeMethodConcrete(this, name, access, descriptor);
    this.methods.add(method);
    return method;
  }
View Full Code Here

 
  public BytecodeMethodConcrete createJavaBeanProperty (final String fieldName, final String getterName, final String setterName) {
    final BytecodeFieldDeclaration field = this.fields.get(fieldName);
    final boolean isStatic = field.getAccess().isStatic();
   
    BytecodeMethodConcrete getter = this.addMethod(getterName,
      new TypeMemberAccess(Scope.Public, false, isStatic, false),
      new MethodDescriptor(false, field.getType(), new TypeDescriptor[0])).setMethodBody(new BytecodeBlock() {
       
        @Override protected void writeInstructions(BytecodeContextMethod context) {
          context.returnValue(isStatic ? context.getStaticField(fieldName) : context.getThisField(fieldName));
View Full Code Here

              );
            }
          }
        );
       
        BytecodeMethodConcrete bmc = this.addMethod(method.getName(), Scope.Public, false, true, method.getDescriptor());
        bmc.copyAnnotations(method);
        bmc.setMethodBody(apmb);
      }
     
      st = st.getSuperType();
    }
   
View Full Code Here

    IBytecodeResolvable st = getSuperType();
    while (st != null && !"java.lang.Object".equals( st.getType().getClassName() )) {
      for (IBytecodeMethod method : st.getDeclaredMethods()) {
        if (method.getAccess().isStatic() || method.getAccess().getScope() != Scope.Public) continue;
       
        BytecodeMethodConcrete bmc = this.addMethod(method.getName(), Scope.Public, false, true, method.getDescriptor());
        bmc.copyAnnotations(method);
        bmc.setMethodBody(apmb);
      }
     
      st = st.getSuperType();
    }
   
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.bytecode.api.type.method.BytecodeMethodConcrete

Copyright © 2018 www.massapicom. 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.