Examples of FieldNode


Examples of jadx.core.dex.nodes.FieldNode

   */
  private static void processStaticFieldAssign(ClassNode cls, IndexInsnNode insn) {
    FieldInfo field = (FieldInfo) insn.getIndex();
    String thisClass = cls.getFullName();
    if (field.getDeclClass().getFullName().equals(thisClass)) {
      FieldNode fn = cls.searchField(field);
      if (fn != null && fn.getAccessFlags().isFinal()) {
        fn.remove(AType.FIELD_VALUE);
      }
    }
  }
View Full Code Here

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

      InterfaceNode iNode = (InterfaceNode) node;
      return this.offsets.get(iNode.getInterface());
    } else if (node instanceof FieldsNode) {
      return this.offsets.get(ClassFile.OffsetTag.FIELD_DATA);
    } else if (node instanceof FieldNode) {
      FieldNode fNode = (FieldNode) node;
      return this.offsets.get(fNode.getField());
    } else if (node instanceof MethodsNode) {
      return this.offsets.get(ClassFile.OffsetTag.METHOD_DATA);
    } else if (node instanceof MethodNode) {
      MethodNode mNode = (MethodNode) node;
      return this.offsets.get(mNode.getMethod());
    } else if (node instanceof MethodAccessFlagsNode) {
      Range parentRange = getRange((StructureNode)node.getParent());
      MethodAccessFlagsNode mafNode = (MethodAccessFlagsNode) node;
      Method method = mafNode.getMethod();
      Range afRange = method.getOffsetMap().get(Method.OffsetTag.ACCESS_FLAGS);
      return afRange.offsetBy(parentRange.getOffset());
    } else if (node instanceof MethodNameNode) {
      Range parentRange = getRange((StructureNode)node.getParent());
      MethodNameNode mafNode = (MethodNameNode) node;
      Method method = mafNode.getMethod();
      Range afRange = method.getOffsetMap().get(Method.OffsetTag.METHOD_NAME);
      return afRange.offsetBy(parentRange.getOffset());
    } else if (node instanceof MethodDescriptorNode) {     
      Range parentRange = getRange((StructureNode)node.getParent());
      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();
View Full Code Here

Examples of org.apache.tapestry5.internal.plastic.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.apache.tapestry5.internal.plastic.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.apache.tapestry5.internal.plastic.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.codehaus.groovy.ast.FieldNode

        ClassNode classNode = controller.getClassNode();
        String methodName = call.getMethodAsString();
        if (methodName==null) return false;
        if (!call.isImplicitThis()) return false;
        if (!AsmClassGenerator.isThisExpression(call.getObjectExpression())) return false;
        FieldNode field = classNode.getDeclaredField(methodName);
        if (field == null) return false;
        if (isStaticInvocation(call) && !field.isStatic()) return false;
        Expression arguments = call.getArguments();
        return ! classNode.hasPossibleMethod(methodName, arguments);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.FieldNode

    public void init(final ClassNode type) {
        Validate.notNull(type);

        StaticMethodCallExpression checkAssertionsEnabledMethodCall = new StaticMethodCallExpression(ClassHelper.makeWithoutCaching(Configurator.class), "checkAssertionsEnabled", new ArgumentListExpression(new ConstantExpression(type.getName())));

        final FieldNode fieldNode = type.addField(BaseVisitor.GCONTRACTS_ENABLED_VAR, Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_FINAL, ClassHelper.boolean_TYPE, checkAssertionsEnabledMethodCall);

        fieldNode.setSynthetic(true);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.FieldNode

                if (v == null) {
                    // variable is not on stack because we are
                    // inside a nested Closure and this variable
                    // was not used before
                    // then load it from the Closure field
                    FieldNode field = classNode.getDeclaredField(name);
                    mv.visitVarInsn(ALOAD, 0);
                    mv.visitFieldInsn(GETFIELD, controller.getInternalClassName(), name, BytecodeHelper.getTypeDescription(field.getType()));
                } else {
                    mv.visitVarInsn(ALOAD, v.getIndex());
                }
                if (param.getNodeMetaData(ClosureWriter.UseExistingReference.class)==null) {
                        param.setNodeMetaData(ClosureWriter.UseExistingReference.class,Boolean.TRUE);
View Full Code Here

Examples of org.codehaus.groovy.ast.FieldNode

                initialValue.setAccessedVariable(param);
                initialValue.setUseReferenceDirectly(true);
                ClassNode realType = type;
                type = ClassHelper.makeReference();
                param.setType(ClassHelper.makeReference());
                FieldNode paramField = answer.addField(paramName, ACC_PRIVATE | ACC_SYNTHETIC, type, initialValue);
                paramField.setOriginType(ClassHelper.getWrapper(param.getOriginType()));
                paramField.setHolder(true);
                String methodName = Verifier.capitalize(paramName);

                // let's add a getter & setter
                Expression fieldExp = new FieldExpression(paramField);
                answer.addMethod(
View Full Code Here

Examples of org.codehaus.groovy.ast.FieldNode

            public void visitVariableExpression(VariableExpression expression) {
                Variable v = expression.getAccessedVariable();
                if (v==null) return;
                if (!(v instanceof FieldNode)) return;
                String name = expression.getName();
                FieldNode fn = closureClass.getDeclaredField(name);
                if (fn != null) { // only overwrite if we find something more specific
                    expression.setAccessedVariable(fn);
                }
            } 
        };
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.