/** * {@inheritDoc} */ public Generic accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor) { List<TypeDescription.Generic> visited = new ArrayList<TypeDescription.Generic>(size()); for (TypeDescription.Generic typeDescription : this) { visited.add(typeDescription.accept(visitor)); } return new Explicit(visited); }
/** * {@inheritDoc} */ public TypeDescription.Generic getType() { return fieldDescription.getType().accept(visitor); }
/** * {@inheritDoc} */ public void apply(FieldVisitor fieldVisitor, FieldDescription fieldDescription, AnnotationValueFilter annotationValueFilter) { AnnotationAppender annotationAppender = new AnnotationAppender.Default(new AnnotationAppender.Target.OnField(fieldVisitor)); annotationAppender = fieldDescription.getType().accept(AnnotationAppender.ForTypeAnnotations.ofFieldType(annotationAppender, annotationValueFilter)); for (AnnotationDescription annotation : fieldDescription.getDeclaredAnnotations()) { annotationAppender = annotationAppender.append(annotation, annotationValueFilter); } }
/** * {@inheritDoc} */ public Token accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor) { return new Token(name, modifiers, type.accept(visitor), annotations); }
/** * {@inheritDoc} */ public <T> T accept(Visitor<T> visitor) { return resolve().accept(visitor); }
/** * {@inheritDoc} */ public Generic getOwnerType() { Generic ownerType = parameterizedType.getOwnerType(); return ownerType == null ? Generic.UNDEFINED : ownerType.accept(Visitor.Reifying.INHERITING); }
/** * {@inheritDoc} */ public Boolean onWildcard(Generic wildcard) { if (!isValid(wildcard)) { return false; } TypeList.Generic lowerBounds = wildcard.getLowerBounds(); return (lowerBounds.isEmpty() ? wildcard.getUpperBounds() : lowerBounds).getOnly().accept(this); }
/** * {@inheritDoc} */ public Boolean onGenericArray(Generic genericArray) { return this.genericArray.getComponentType().accept(Assigner.INSTANCE).isAssignableFrom(genericArray.getComponentType()); }
/** * Creates a signature token that represents the method that is represented by this token. * * @param declaringType The declaring type of the field that this token represents. * @return A signature token representing this token. */ public SignatureToken asSignatureToken(TypeDescription declaringType) { return new SignatureToken(name, type.accept(new TypeDescription.Generic.Visitor.Reducing(declaringType))); }
/** * {@inheritDoc} */ public TypeDescription.Generic getType() { return fieldType.accept(TypeDescription.Generic.Visitor.Substitutor.ForAttachment.of(this)); }
/** * {@inheritDoc} */ public TypeDescription.Generic getReceiverType() { TypeDescription.Generic receiverType = methodDescription.getReceiverType(); return receiverType == null ? TypeDescription.Generic.UNDEFINED : receiverType.accept(visitor); }
/** * {@inheritDoc} */ public TypeDescription.Generic getReturnType() { return methodDescription.getReturnType().accept(visitor); }
/** * {@inheritDoc} */ public Boolean onNonGenericType(Generic typeDescription) { return isValid(typeDescription) && (!typeDescription.isArray() || typeDescription.getComponentType().accept(this)); }
/** {@inheritDoc} */ public Boolean onTypeVariable(Generic typeVariable) { for (TypeDescription.Generic bound : typeVariable.getUpperBounds()) { if (bound.accept(this)) { return true; } } return false; }
/** * {@inheritDoc} */ public AnnotationAppender onWildcard(TypeDescription.Generic wildcard) { TypeList.Generic lowerBounds = wildcard.getLowerBounds(); return (lowerBounds.isEmpty() ? wildcard.getUpperBounds().getOnly() : lowerBounds.getOnly()).accept(new ForTypeAnnotations(apply(wildcard, typePath), annotationValueFilter, typeReference, typePath + WILDCARD_TYPE_PATH)); }
@Override @CachedReturnPlugin.Enhance("resolved") protected Generic resolve() { return delegate.accept(visitor); } }
/** * {@inheritDoc} */ public Boolean onGenericArray(Generic genericArray) { return isValid(genericArray) && genericArray.getComponentType().accept(this); }
/** * {@inheritDoc} */ public boolean isAssignableFrom(Generic typeDescription) { if (typeDescription.getSort().isWildcard()) { return typeDescription.getLowerBounds().isEmpty() && upperBound.accept(Assigner.INSTANCE) .isAssignableFrom(typeDescription.getUpperBounds().getOnly()); } else { return upperBound.accept(Assigner.INSTANCE).isAssignableFrom(typeDescription); } } }
/** * {@inheritDoc} */ public Generic onParameterizedType(Generic parameterizedType) { Generic ownerType = parameterizedType.getOwnerType(); return new OfParameterizedType.Latent(parameterizedType.asErasure(), ownerType == null ? UNDEFINED : ownerType.accept(this), parameterizedType.getTypeArguments().accept(this), Empty.INSTANCE); }
/** * {@inheritDoc} */ public TypeDescription.Generic getReturnType() { return token.getReturnType().accept(new AttachmentVisitor()); }