Package net.sf.rej.java

Examples of net.sf.rej.java.AccessFlags


        this.className = className;
        this.superName = superName;
        this.remainingInterfaces = remainingInterfaces;
        this.newInterfaceNames = newInterfaces;

        this.oldAccessFlags = new AccessFlags(this.cf.getAccessFlags());
        this.oldInterfaces = this.cf.getInterfaces();
        this.oldClassIndex = this.cf.getThisClass();
        this.oldSuperIndex = this.cf.getSuperClass();
    }
View Full Code Here


    setLocationRelativeTo(getOwner());
        setVisible(true);
    }

    public AccessFlags getFlags() {
        AccessFlags flags = new AccessFlags();
        flags.setAbstract(this.abstractCheck.isSelected());
        flags.setFinal(this.finalCheck.isSelected());
        flags.setInterface(this.interfaceCheck.isSelected());
        flags.setPrivate(this.privateCheck.isSelected());
        flags.setProtected(this.protectedCheck.isSelected());
        flags.setPublic(this.publicCheck.isSelected());
        flags.setStatic(this.staticCheck.isSelected());

        return flags;
    }
View Full Code Here

    setLocationRelativeTo(getOwner());
        setVisible(true);
    }

    public AccessFlags getAccessFlags() {
        AccessFlags flags = new AccessFlags();
        flags.setAbstract(this.abstractCheck.isSelected());
        flags.setFinal(this.finalCheck.isSelected());
        flags.setNative(this.nativeCheck.isSelected());
        flags.setPrivate(this.privateCheck.isSelected());
        flags.setProtected(this.protectedCheck.isSelected());
        flags.setPublic(this.publicCheck.isSelected());
        flags.setStatic(this.staticCheck.isSelected());
        flags.setSynchronized(this.synchronizedCheck.isSelected());

        return flags;
    }
View Full Code Here

        this.field = field;
        this.fieldName = name;
        this.desc = desc;
        this.flags = accessFlags;

        this.oldFlags = new AccessFlags(field.getAccessFlags());
        this.oldNameIndex = field.getNameIndex();
        this.oldDescIndex = field.getDescriptorIndex();
    }
View Full Code Here

    public String getFieldName() {
      return this.nameField.getText();
    }

    public AccessFlags getAccessFlags() {
        AccessFlags flags = new AccessFlags();
        flags.setAbstract(this.abstractCheck.isSelected());
        flags.setFinal(this.finalCheck.isSelected());
        flags.setNative(this.nativeCheck.isSelected());
        flags.setPrivate(this.privateCheck.isSelected());
        flags.setProtected(this.protectedCheck.isSelected());
        flags.setPublic(this.publicCheck.isSelected());
        flags.setStatic(this.staticCheck.isSelected());
        flags.setSynchronized(this.synchronizedCheck.isSelected());

        return flags;
    }
View Full Code Here

        this.desc = desc;
        this.flags = accessFlags;
        this.maxStackSize = maxStack;
        this.maxLocals = maxLocals;

        this.oldFlags = new AccessFlags(method.getAccessFlags());

        this.hasCode = method.getAttributes().getCode() != null;
        if (hasCode) {
          this.oldStack = method.getAttributes().getCode().getMaxStackSize();
          this.oldLocals = method.getAttributes().getCode().getMaxLocals();
View Full Code Here

            .getDescriptor(), method.getAccessFlags(), null, null,
            method.getExceptions());
      }

      if (!this.methodEditor.wasCancelled()) {
        AccessFlags af = this.methodEditor.getAccessFlags();
        String name = this.methodEditor.getMethodName();
        Descriptor desc = this.methodEditor.getDescriptor();
        int maxStack = this.methodEditor.getMaxStack();
        int maxLocals = this.methodEditor.getMaxLocals();

        EditorFacade.getInstance().modifyMethod(
            mdr.getClassFile().getPool(), mdr.getMethod(), name,
            desc, af, maxStack, maxLocals,
            methodEditor.getExceptions());
      }

    } else if (o instanceof FieldDefRow) {
      FieldDefRow fdr = (FieldDefRow) o;
      Field field = fdr.getField();
      int flags = field.getAccessFlags();
      this.fieldEditor.invoke(field.getName(), field.getDescriptor(),
          flags);

      if (!this.fieldEditor.wasCancelled()) {
        AccessFlags af = this.fieldEditor.getAccessFlags();
        String name = this.fieldEditor.getFieldName();
        Descriptor desc = this.fieldEditor.getType();

        EditorFacade.getInstance().modifyField(
            fdr.getClassFile().getPool(), fdr.getField(), name,
            desc, af);
      }
    } else if (o instanceof ClassDefRow) {
      ClassDefRow cdr = (ClassDefRow) o;
      ClassFile cf = cdr.getClassFile();
      this.classEditor.invoke(cf.getFullClassName(), cf
          .getSuperClassName(), cf.getAccessFlags(), cf
          .getInterfaces());

      if (!this.classEditor.wasCancelled()) {
        String name = this.classEditor.getClassName();
        String superName = this.classEditor.getSuperClassname();
        AccessFlags flags = this.classEditor.getFlags();
        List<String> intfs = this.classEditor.getInterfaces();
        /* new list as user has modified it */
        List<Interface> remainingInterfaces = new ArrayList<Interface>();
        /* interfaces that remain untouched */
        List<Interface> old = cf.getInterfaces();
View Full Code Here

        if (transferrable instanceof TransferrableField) {
          TransferrableField field = (TransferrableField) transferrable;

          Undoable insertFieldAction = new InsertFieldAction(
              this.classDef.getClassFile(), field.getFieldName(),
              field.getDescriptor(), new AccessFlags(field
                  .getAccessFlags()));
          ga.add(insertFieldAction);
        } else if (transferrable instanceof TransferrableMethod) {
          TransferrableMethod method = (TransferrableMethod) transferrable;
          int maxStack = 0;
          int maxLocals = 0;
          if (method.getMaxStack() != null) {
            maxStack = method.getMaxStack();
          }
          if (method.getMaxLocals() != null) {
            maxLocals = method.getMaxLocals();
          }
          // TODO: Attributes are not being copied
          InsertMethodAction insertMethodAction = new InsertMethodAction(
              this.classDef.getClassFile(), method
                  .getMethodName(), method.getDescriptor(),
              new AccessFlags(method.getAccessFlags()), maxStack,
              maxLocals, method.getExceptions());
          ga.add(insertMethodAction);
          InsertCodeToNewMethodAction ictnma = new InsertCodeToNewMethodAction(
              this.classDef.getClassFile(), insertMethodAction,
              method.getCode());
View Full Code Here

      }
      ClassFile cf = factory.createClass(rt.name(), superClass);
      ConstantPool cp = cf.getPool();
      FieldFactory fieldFactory = new FieldFactory();
      for (IField field : rt.visibleFields()) {
        AccessFlags flags = new AccessFlags(field.modifiers());
        Field fieldToAdd = fieldFactory.createField(cf, flags, cp.optionalAddUtf8(field.name()), cp.optionalAddUtf8(field.signature()));
        cf.add(fieldToAdd);
      }
     
      MethodFactory methodFactory = new MethodFactory();
      for (IMethod method : rt.visibleMethods()) {
        AccessFlags flags = new AccessFlags(method.modifiers());
        net.sf.rej.java.Method methodToAdd = methodFactory.createMethod(cf, flags, cp.optionalAddUtf8(method.name()), cp.optionalAddUtf8(method.signature()), cp.optionalAddUtf8("Code"), 0, 0, cp.optionalAddUtf8("Exceptions"), new ArrayList<ExceptionDescriptor>());
        cf.add(methodToAdd);
      }

      SystemFacade.getInstance().setStatus("Class definition pulled from VM: " + sf.location().declaringType().name());
View Full Code Here

TOP

Related Classes of net.sf.rej.java.AccessFlags

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.