/** * {@inheritDoc} */ public boolean matches(FieldDescription target) { return target.asSignatureToken().equals(signatureToken); } }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> getDeclaredFields() { return new FieldList.Empty<FieldDescription.InDefinedShape>(); }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> getDeclaredFields() { return new FieldList.ForTokens(this, fieldTokens); }
@Override protected FieldList<?> locate(ElementMatcher<? super FieldDescription> matcher) { for (TypeDefinition typeDefinition : typeDescription) { FieldList<?> candidates = typeDefinition.getDeclaredFields().filter(matcher); if (!candidates.isEmpty()) { return candidates; } } return new FieldList.Empty<FieldDescription>(); }
/** * Creates a new field setter. * * @param instrumentedType The instrumented type. * @param fieldDescription The field for which a setter is described. * @param suffix The name suffix for the field setter method. */ protected FieldSetter(TypeDescription instrumentedType, FieldDescription fieldDescription, String suffix) { this.instrumentedType = instrumentedType; this.fieldDescription = fieldDescription; name = fieldDescription.getName() + "$" + ACCESSOR_METHOD_SUFFIX + "$" + suffix; }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> asDefined() { List<FieldDescription.InDefinedShape> declaredForms = new ArrayList<FieldDescription.InDefinedShape>(size()); for (FieldDescription fieldDescription : this) { declaredForms.add(fieldDescription.asDefined()); } return new Explicit<FieldDescription.InDefinedShape>(declaredForms); }
/** * {@inheritDoc} */ public InDefinedShape asDefined() { return fieldDescription.asDefined(); } }
@Override protected int getBaseModifiers() { return fieldDescription.isStatic() ? Opcodes.ACC_STATIC : EMPTY_MASK; }
/** * {@inheritDoc} */ public AnnotationList getDeclaredAnnotations() { return fieldDescription.getDeclaredAnnotations(); }
/** * {@inheritDoc} */ public SignatureToken asSignatureToken() { return new SignatureToken(getInternalName(), getType().asErasure()); }
/** * Extracts a handle type for a getter of the given field. * * @param fieldDescription The field for which to create a getter handle. * @return The corresponding handle type. */ protected static HandleType ofGetter(FieldDescription.InDefinedShape fieldDescription) { return fieldDescription.isStatic() ? GET_STATIC_FIELD : GET_FIELD; }
/** * {@inheritDoc} */ public int getModifiers() { return token.getModifiers(); }
/** * {@inheritDoc} */ public AnnotationList getDeclaredAnnotations() { return token.getAnnotations(); }
/** * {@inheritDoc} */ public String getName() { return token.getName(); } }
/** * {@inheritDoc} */ public String getInternalName() { return getName(); }
/** * {@inheritDoc} */ public String getName() { return fieldDescription.getName(); }
/** * Extracts a handle type for a setter of the given field. * * @param fieldDescription The field for which to create a setter handle. * @return The corresponding handle type. */ protected static HandleType ofSetter(FieldDescription.InDefinedShape fieldDescription) { return fieldDescription.isStatic() ? PUT_STATIC_FIELD : PUT_FIELD; }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InGenericShape> getDeclaredFields() { return new FieldList.Empty<FieldDescription.InGenericShape>(); }
/** * Creates a new field getter. * * @param instrumentedType The instrumented type. * @param fieldDescription The field for which a getter is described. * @param suffix The name suffix for the field getter method. */ protected FieldGetter(TypeDescription instrumentedType, FieldDescription fieldDescription, String suffix) { this.instrumentedType = instrumentedType; this.fieldDescription = fieldDescription; name = fieldDescription.getName() + "$" + ACCESSOR_METHOD_SUFFIX + "$" + suffix; }
/** * {@inheritDoc} */ public FieldList<FieldDescription.InDefinedShape> getDeclaredFields() { return new FieldList.Empty<FieldDescription.InDefinedShape>(); }