/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> getDeclaredFields() { return typeDescription.getDeclaredFields(); }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> getDeclaredFields() { return delegate.getDeclaredFields(); }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> getDeclaredFields() { return delegate().getDeclaredFields(); }
/** * {@inheritDoc} */ public FieldDescription.InDefinedShape get(int index) { return instrumentedType.getDeclaredFields().get(index); }
/** * {@inheritDoc} */ public int size() { return instrumentedType.getDeclaredFields().size(); } }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InGenericShape> getDeclaredFields() { return new FieldList.TypeSubstituting(this, typeDescription.getDeclaredFields(), Visitor.TypeErasing.INSTANCE); }
/** * {@inheritDoc} */ public ByteCodeAppender appender(Target implementationTarget) { return new Appender(implementationTarget.getInstrumentedType().getDeclaredFields()); }
/** * {@inheritDoc} */ protected FieldDescription.InDefinedShape initialize(TypeDescription instrumentedType) { return instrumentedType.getDeclaredFields().filter(named(name)).getOnly(); }
/** * {@inheritDoc} */ public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, Sort sort) { return new Target.ForField.ReadWrite(instrumentedType.getDeclaredFields().filter(named(name)).getOnly()); } }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InGenericShape> getDeclaredFields() { TypeDescription erasure = asErasure(); return new FieldList.TypeSubstituting(this, erasure.getDeclaredFields(), TypeDescription.AbstractBase.RAW_TYPES ? Visitor.NoOp.INSTANCE : new Visitor.ForRawType(erasure)); }
/** * Creates a new appender. * * @param implementationTarget The current implementation target. */ protected Appender(Target implementationTarget) { fieldDescription = implementationTarget.getInstrumentedType() .getDeclaredFields() .filter((named(RedirectionProxy.FIELD_NAME))) .getOnly(); }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InGenericShape> getDeclaredFields() { return new FieldList.TypeSubstituting(this, asErasure().getDeclaredFields(), new Visitor.Substitutor.ForTypeVariableBinding(this)); }
/** * {@inheritDoc} */ public TargetHandler make(Implementation.Target implementationTarget) { return new ForValue(implementationTarget.getInstrumentedType().getDeclaredFields().filter(named(name)).getOnly()); } }
/** * {@inheritDoc} */ public ArgumentProvider make(Implementation.Target implementationTarget) { return new ForInstance(implementationTarget.getInstrumentedType().getDeclaredFields().filter(named(name)).getOnly()); } }
/** * Creates a new appender. * * @param instrumentedType The instrumented type that is proxied by the enclosing instrumentation. */ protected Appender(TypeDescription instrumentedType) { fieldLoadingInstruction = FieldAccess.forField(instrumentedType.getDeclaredFields().filter((named(INSTANCE_FIELD))).getOnly()).read(); }
/** * Creates a new byte code appender for returning a value of a static field from an instrumented method. * * @param instrumentedType The instrumented type that is subject of the instrumentation. */ private StaticFieldByteCodeAppender(TypeDescription instrumentedType) { fieldGetAccess = FieldAccess.forField(instrumentedType.getDeclaredFields().filter((named(fieldName))).getOnly()).read(); }
@Override protected FieldDescription resolve(TypeDescription instrumentedType) { if (!fieldType.asErasure().isVisibleTo(instrumentedType)) { throw new IllegalStateException(fieldType + " is not visible to " + instrumentedType); } else { return instrumentedType.getDeclaredFields() .filter(named(fieldName).and(fieldType(fieldType.asErasure()))) .getOnly(); } } }
/** * {@inheritDoc} */ public Size apply(MethodVisitor methodVisitor, Context implementationContext, MethodDescription instrumentedMethod) { return ForInstance.this.apply(methodVisitor, implementationContext, instrumentedMethod, StackManipulation.Trivial.INSTANCE, instrumentedType.getDeclaredFields().filter(named(fieldName).and(genericFieldType(INVOCATION_HANDLER_TYPE))).getOnly()); } }
/** * {@inheritDoc} */ public ByteCodeAppender appender(Target implementationTarget) { if (implementationTarget.getInstrumentedType().isInterface()) { throw new IllegalStateException("Cannot implement meaningful hash code method for " + implementationTarget.getInstrumentedType()); } return new Appender(offsetProvider.resolve(implementationTarget.getInstrumentedType()), multiplier, implementationTarget.getInstrumentedType().getDeclaredFields().filter(not(isStatic().or(ignored))), nonNullable); }
/** * {@inheritDoc} */ public Resolved resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing) { FieldDescription fieldDescription = instrumentedType.getDeclaredFields().filter(named(name)).getOnly(); StackManipulation stackManipulation = assigner.assign(fieldDescription.getType(), fieldType.asGenericType(), typing); if (!stackManipulation.isValid()) { throw new IllegalStateException("Cannot assign " + fieldDescription + " to " + fieldType); } return new Resolved.Simple(new StackManipulation.Compound(FieldAccess.forField(fieldDescription).read(), stackManipulation), fieldDescription.getType().asErasure()); }