Package net.sf.rej.gui.structure

Examples of net.sf.rej.gui.structure.AttributeNode


      MethodDescriptorNode mafNode = (MethodDescriptorNode) node;
      Method method = mafNode.getMethod();
      Range afRange = method.getOffsetMap().get(Method.OffsetTag.METHOD_DESCRIPTOR);
      return afRange.offsetBy(parentRange.getOffset());
    } else if (node instanceof AttributeNode) {
      AttributeNode aNode = (AttributeNode) node;
      AttributesNode an = (AttributesNode) aNode.getParent();
      Range range = getRange(an);
      Map<Object, Range> map = an.getAttributesObject().getOffsetMap(range.getOffset());
      return map.get(aNode.getAttributeObject());
    } else if (node instanceof AttributesNode) {
      StructureNode parent = (StructureNode) node.getParent();
      if (parent instanceof ClassFileNode) {
        return this.offsets.get(ClassFile.OffsetTag.ATTRIBUTES);
      } else if (parent instanceof MethodNode) {
        MethodNode mNode = (MethodNode) parent;
        Range parentRange = getRange(parent);
        Map<Object, Range> map = mNode.getMethod().getOffsetMap();
        return map.get(Method.OffsetTag.ATTRIBUTES).offsetBy(parentRange.getOffset());
      } else if (parent instanceof FieldNode) {
        FieldNode fNode = (FieldNode) parent;
        Range parentRange = getRange(parent);
        Map<Object, Range> map = fNode.getField().getOffsetMap();
        return map.get(Field.OffsetTag.ATTRIBUTES).offsetBy(parentRange.getOffset());
      } else if (parent instanceof AttributeNode) {
        // code attribute attributes
        AttributeNode aNode = (AttributeNode) parent;
        CodeAttribute cAttr = (CodeAttribute) aNode.getAttributeObject();
        Range range = cAttr.getOffsetMap().get(CodeAttribute.OffsetTag.ATTRIBUTES);
        Range parentRange = getRange(parent);
        return range.offsetBy(parentRange.getOffset());
      }
      return null;
View Full Code Here

TOP

Related Classes of net.sf.rej.gui.structure.AttributeNode

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.