Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.FieldNode


        while (current != null) {
            if (owner.equals(current.name)) {
                @SuppressWarnings("rawtypes") // ASM API
                List fieldList = current.fields;
                for (Object f : fieldList) {
                    FieldNode field = (FieldNode) f;
                    if (field.name.equals(name)) {
                        return field;
                    }
                }
                return null;
View Full Code Here


        // for members and <clinit> for static fields).
        if (instruction != null && method.name.charAt(0) == '<') {
            AbstractInsnNode next = LintUtils.getNextInstruction(instruction);
            if (next != null && next.getType() == AbstractInsnNode.FIELD_INSN) {
                FieldInsnNode fieldRef = (FieldInsnNode) next;
                FieldNode field = findField(classNode, fieldRef.owner, fieldRef.name);
                if (field != null && isSuppressed(issue, field)) {
                    return true;
                }
            } else if (classNode.outerClass != null && classNode.outerMethod == null
                        && isAnonymousClass(classNode)) {
View Full Code Here

        while (current != null) {
            if (owner.equals(current.name)) {
                @SuppressWarnings("rawtypes") // ASM API
                List fieldList = current.fields;
                for (Object f : fieldList) {
                    FieldNode field = (FieldNode) f;
                    if (field.name.equals(name)) {
                        return field;
                    }
                }
                return null;
View Full Code Here

  @Test
  public void combineField() throws Exception {

    ClassNode classNode = UtilAsm.classNode(ComboField.class);

    FieldNode fieldNode = (FieldNode) classNode.fields.get(0);

    List<AnnotationNode> list = UtilAsm.combine(fieldNode);

    assertEquals(2, list.size());
View Full Code Here

        putBehavior(theKey, new JNormalBehavior(this, theMethodNode));
      }
     
      for (Iterator theIterator = itsNode.fields.iterator(); theIterator.hasNext();)
      {
        FieldNode theFieldNode = (FieldNode) theIterator.next();
        JType theType = getInterpreter().getType(theFieldNode.desc);
       
        JField theField = (theFieldNode.access & Opcodes.ACC_STATIC) != 0 ?
            getInterpreter().createStaticField(this, theFieldNode.name, theType, theFieldNode.access)
            : new JField(this, theFieldNode.name, theType, theFieldNode.access);
View Full Code Here

    Detector save = Detector.setDetector(detector);
    try {
   
        cr.accept(this, false);
        for (Object o: this.fields) {
            FieldNode fn = (FieldNode)o;
            if (fn.name.equals(Constants.WOVEN_FIELD)) {
                isWoven = true; break;
            }
        }
       
View Full Code Here

        setTileEntity = m;
      } else if (names[6].equals(remapper.mapMethodName(name, m.name, m.desc)) && "()V".equals(remapper.mapMethodDesc(m.desc))) {
        updateEntities = m;
      }
    }
    cn.fields.add(new FieldNode(ACC_PRIVATE, "cofh_recentTiles", "Lcofh/lib/util/LinkedHashList;", null, null));
    if (addTileEntity != null) {

      LabelNode a = new LabelNode(new Label());
      AbstractInsnNode n;
      addTileEntity.instructions.insert(n = a);
View Full Code Here

      }
    }
    if (cn.fields != null) {
      Iterator<FieldNode> iter = cn.fields.iterator();
      while (iter.hasNext()) {
        FieldNode fn = iter.next();
        if (fn.visibleAnnotations != null) {
          for (AnnotationNode node : fn.visibleAnnotations) {
            if (checkRemove(parseAnnotation(node, strippableDesc), iter)) {
              altered = true;
              break;
View Full Code Here

        return type;
    }

    public FieldNode getFieldNode()
    {
        return new FieldNode(
                toAccessModifier(access),
                name,
                type.getType(),
                type.getGenericSignature(),
                null);
View Full Code Here

          int paramInt, boolean paramBoolean1, boolean paramBoolean2) {
        Component renderer =
            super.getListCellRendererComponent(paramJList, paramObject, paramInt, paramBoolean1,
                paramBoolean2);
        if (renderer instanceof JLabel && paramObject instanceof FieldNode) {
          FieldNode fn = (FieldNode) paramObject;
          ((JLabel) renderer).setText(fn.name + ' ' + fn.desc);
        }
        return renderer;
      }

    });
    fieldModel = new DefaultListModel<FieldNode>();
    for (FieldNode fn : (List<FieldNode>) cNode.fields) {
      fieldModel.addElement(fn);
    }
    list.setModel(fieldModel);
    list.addListSelectionListener(new ListSelectionListener() {

      @Override
      public void valueChanged(ListSelectionEvent paramListSelectionEvent) {
        onSelected(list.getSelectedValue());
      }
    });
    panelFieldListings.add(list);

    JPanel panelFieldInfo = new JPanel();
    splitPane.setRightComponent(panelFieldInfo);
    panelFieldInfo.setLayout(new BorderLayout(0, 0));

    JPanel panelListControls = new JPanel();
    panelListControls.setBorder(new LineBorder(new Color(0, 0, 0)));
    panelFieldInfo.add(panelListControls, BorderLayout.NORTH);
    panelListControls.setLayout(new WrapLayout());

    JButton btnAddField = new JButton("Add Field...");
    panelListControls.add(btnAddField);

    JButton btnRemoveField = new JButton("Remove Field");
    btnRemoveField.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent paramActionEvent) {
        FieldNode fn = list.getSelectedValue();
        if (fn != null) {
          fieldModel.removeElement(fn);
          cNode.fields.remove(fn);
        }
      }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.FieldNode

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.