Examples of FieldNode


Examples of org.objectweb.asm.tree.FieldNode

            initialValue = new Double(((IReal)((IConstructor)v).get(4)).doubleValue());
          } else if (desc.equals("Ljava/lang/String;")) {
            initialValue = ((IString)((IConstructor)v).get(4)).getValue();
          }
        }
        al.add(new FieldNode(((IInteger)((IConstructor)v).get(0)).intValue(),
                   ((IString)((IConstructor)v).get(1)).getValue(),
                   ((IString)((IConstructor)v).get(2)).getValue(),
                   emptyIsNull(((IString)((IConstructor)v).get(3)).getValue()),
                   initialValue));
      }
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

  }

  @SuppressWarnings("unchecked")
  private static void removeFields(ClassNode cn, List<String> names) {
    for (Iterator<FieldNode> it = cn.fields.iterator(); it.hasNext() ;) {
      FieldNode next = it.next();
      if (names.contains(next.name)) {
        it.remove();
      }
    }
  }
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

    private String descriptor(Class<? extends Annotation> type) {
        return Type.getType(type).getDescriptor();
    }

    private FieldNode fieldNode() {
        return new FieldNode(0,
                             "field",
                             Type.getType(Object.class).getDescriptor(),
                             null,
                             null);
    }
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

        String name = makeUnique(fieldNames, suggestedName);

        // No signature and no initial value

        FieldNode fieldNode = new FieldNode(ACC_PRIVATE, name, PlasticInternalUtils.toDescriptor(className), null, null);

        classNode.fields.add(fieldNode);

        fieldNames.add(name);
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

            instanceContextFieldName = makeUnique(fieldNames, "instanceContext");

            // TODO: Once we support inheritance, we could use a protected field and only initialize
            // it once, in the first base class where it is needed.

            FieldNode node = new FieldNode(ACC_PRIVATE | ACC_FINAL, instanceContextFieldName, INSTANCE_CONTEXT_DESC,
                    null, null);

            classNode.fields.add(node);

            // Extend the constructor to store the context in a field.
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

    private String createAndInitializeFieldFromStaticContext(String suggestedFieldName, String fieldType,
            Object injectedFieldValue)
    {
        String name = makeUnique(fieldNames, suggestedFieldName);

        FieldNode field = new FieldNode(ACC_PRIVATE | ACC_FINAL, name, nameCache.toDesc(fieldType), null, null);

        classNode.fields.add(field);

        initializeFieldFromStaticContext(name, fieldType, injectedFieldValue);
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

         */
        public Predicate named(final String expected) {
            return new Predicate() {
                public boolean matches(BindingContext context) {
                    if (context.getFieldNode() != null) {
                        FieldNode field = context.getFieldNode();
                        return field.name.equals(expected);
                    }

                    if (context.getMethodNode() != null) {
                        MethodNode method = context.getMethodNode();
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

     * @return the field visitor.
     * @see org.objectweb.asm.ClassVisitor#visitField(int, java.lang.String, java.lang.String, java.lang.String,
     * java.lang.Object)
     */
    public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
        return new FieldMetadataCollector(workbench, new FieldNode(access, name, desc, signature, value));
    }
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

                if (index == fields.size()) {
                    // CAUTION, HACK!: for brevity we reuse the access field and the value field of the FieldNode
                    // for keeping track of the original var index as well as the FieldNodes Type (respectively)
                    // so we need to make sure that we correct for this when the field is actually written
                    Type type = node.getResultValue().getType();
                    fields.add(new FieldNode(insn.var, "field$" + index, type.getDescriptor(), null, type));
                }

                // normalize the instruction so instruction groups that are identical except for the variable
                // indexes are still mapped to the same group class (name)
                insn.var = index;
View Full Code Here

Examples of org.objectweb.asm.tree.FieldNode

                if (index == fields.size()) {
                    // CAUTION, HACK!: for brevity we reuse the access field and the value field of the FieldNode
                    // for keeping track of the original var index as well as the FieldNodes Type (respectively)
                    // so we need to make sure that we correct for this when the field is actually written
                    Type type = node.getResultValue().getType();
                    fields.add(new FieldNode(insn.var, "field$" + index, type.getDescriptor(), null, type));
                }

                // normalize the instruction so instruction groups that are identical except for the variable
                // indexes are still mapped to the same group class (name)
                insn.var = index;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.