Package net.sourceforge.javautil.bytecode.api

Examples of net.sourceforge.javautil.bytecode.api.TypeMemberAccess


  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));
        }
       
      });
   
    if (setterName != null) {
      this.addMethod(setterName,
        new TypeMemberAccess(Scope.Public, false, isStatic, false),
        new MethodDescriptor(false, TypeDescriptor.VOID, new TypeDescriptor[0], field.getType())).setMethodBody(new BytecodeBlock() {
         
          @Override protected void writeInstructions(BytecodeContextMethod context) {
            context.setArrayIndexValue(isStatic ? context.getStaticField(fieldName) : context.getThisField(fieldName), context.getDeclaredParameter(0));
          }
View Full Code Here


   * @version $Id$
   */
  public class DefaultConstructor extends BytecodeConstructorBase {

    public DefaultConstructor() {
      super(JavaClass.this, new TypeMemberAccess(Scope.Public, false, false, false), false);
     
      this.setMethodBody(new BytecodeBlock() {
       
        @Override protected void writeInstructions(BytecodeContextMethod context) {
          context.createSuperConstructorInvocation().load(context);
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.bytecode.api.TypeMemberAccess

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.