Package net.sf.rej.java.attribute

Examples of net.sf.rej.java.attribute.Attributes


    return "Attributes (" + this.attributes.size() + ")";
  }

  public void refresh() {
    this.attributes = new ArrayList<AttributeNode>();
    Attributes attrs = this.method.getAttributes();
    List list = attrs.getAttributes();
    for (int i = 0; i < list.size(); i++) {
      Attribute attr = (Attribute) list.get(i);
      this.attributes.add(new AttributeNode(attrs, attr));
    }
  }
View Full Code Here


            Method method = new Method(parser, cf.getPool());
            methods.add(method);
        }
        cf.setMethods(methods);

        cf.setAttributes(new Attributes(parser, cf.getPool()));
        return cf;
    }
View Full Code Here

    }

    MethodDefRow mdr = new MethodDefRow(cf, method, true, method.getAttributes().getCode() != null);
    list.add(mdr);

    Attributes attr = method.getAttributes();
    CodeAttribute codeAttr = attr.getCode();

    LineNumberTableAttribute lnAttr = null;
    LocalVariableTableAttribute lvs = null;
    if (codeAttr != null) {
      if (codeAttr.getAttributes() != null) {
View Full Code Here

      rowsB.add(mdrB);
      rowsAll.add(mdrA);
      rowsAll.add(mdrB);
    }

    Attributes attrA = methodA.getAttributes();
    Attributes attrB = methodB.getAttributes();
    CodeAttribute codeAttrA = attrA.getCode();
    CodeAttribute codeAttrB = attrB.getCode();

    LineNumberTableAttribute lnAttrA = null;
    LineNumberTableAttribute lnAttrB = null;
    LocalVariableTableAttribute lvsA = null;
    LocalVariableTableAttribute lvsB = null;
View Full Code Here

  public void refresh() {
    this.subs = new ArrayList<AttributesNode>();
    if (this.attribute instanceof CodeAttribute) {
      CodeAttribute ca = (CodeAttribute) this.attribute;
      Attributes attrs = ca.getAttributes();
      AttributesNode attrsNode = new AttributesNode(attrs);
      attrsNode.setParent(this);
      this.subs.add(attrsNode);
    }
  }
View Full Code Here

                this.createdPoolItems.add(exIndex);
          }
          exceptionList.add(new ExceptionDescriptor(cp, exIndex));
        }

        Attributes attrs = method.getAttributes();
        ExceptionsAttribute ea = new ExceptionsAttribute(exAttrNameIndex, this.cp, exceptionList);
        if (this.oldExAttr != null) {
          attrs.removeAttribute(this.oldExAttr);
        }
        attrs.addAttribute(ea);
    }
View Full Code Here

        if (hasCode) {
          this.method.getAttributes().getCode().setStackSize(this.oldStack);
          this.method.getAttributes().getCode().setMaxLocals(this.oldLocals);
        }

        Attributes attrs = method.getAttributes();
        attrs.removeAttribute(attrs.getExceptionsAttribute());
        if (this.oldExAttr != null) {
          attrs.addAttribute(this.oldExAttr);
        }

        for (int index : this.createdPoolItems) {
          this.cp.removeLast(index);
        }
View Full Code Here

  @Override
  public void processAttribute(IterationContext ic, Attribute attr) {
    if (attr instanceof LineNumberTableAttribute) {
      LineNumberTableAttribute lnAttr = (LineNumberTableAttribute) attr;
      Attributes attrs = ic.getCodeAttribute().getAttributes();
      Undoable u = new RemoveAttributeAction(attrs, lnAttr);
      if (batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());
View Full Code Here

        ConstantPool cp = cf.getPool();
        Method method = new Method(cp);
        method.setAccessFlags(accessFlags);
        method.setNameIndex(nameIndex);
        method.setDescriptorIndex(descIndex);
        Attributes attributes = new Attributes();
        CodeAttribute ca = new CodeAttribute(codeAttrNameIndex, cp, maxStackSize, maxLocals);
        attributes.addAttribute(ca);
        ExceptionsAttribute ea = new ExceptionsAttribute(exAttrNameIndex, cp, exceptions);
        attributes.addAttribute(ea);
        method.setAttributes(attributes);
        return method;
    }
View Full Code Here

  @Override
  public void processAttribute(IterationContext ic, Attribute attr) {
    if (attr instanceof LocalVariableTableAttribute) {
      LocalVariableTableAttribute lvAttr = (LocalVariableTableAttribute) attr;
      Attributes attrs = ic.getCodeAttribute().getAttributes();
      Undoable u = new RemoveAttributeAction(attrs, lvAttr);
      if (this.batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());
View Full Code Here

TOP

Related Classes of net.sf.rej.java.attribute.Attributes

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.