/** * {@inheritDoc} */ public MethodDescription.Token asToken(ElementMatcher<? super TypeDescription> matcher) { TypeDescription.Generic receiverType = getReceiverType(); return new MethodDescription.Token(getInternalName(), getModifiers(), getTypeVariables().asTokenList(matcher), getReturnType().accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher)), getParameters().asTokenList(matcher), getExceptionTypes().accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher)), getDeclaredAnnotations(), getDefaultValue(), receiverType == null ? TypeDescription.Generic.UNDEFINED : receiverType.accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher))); }
/** * {@inheritDoc} */ public Token asToken(ElementMatcher<? super TypeDescription> matcher) { return new Token(getType().accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher)), getDeclaredAnnotations(), isNamed() ? getName() : Token.NO_NAME, hasModifiers() ? (Integer) getModifiers() : Token.NO_MODIFIERS); }
/** * {@inheritDoc} */ public FieldDescription.Token asToken(ElementMatcher<? super TypeDescription> matcher) { return new FieldDescription.Token(getName(), getModifiers(), getType().accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher)), getDeclaredAnnotations()); }
/** * Transforms a type variable into a type variable token with its bounds detached. * * @param typeVariable A type variable in its attached state. * @param matcher A matcher that identifies types to detach from the upper bound types. * @return A token representing the detached type variable. */ public static TypeVariableToken of(TypeDescription.Generic typeVariable, ElementMatcher<? super TypeDescription> matcher) { return new TypeVariableToken(typeVariable.getSymbol(), typeVariable.getUpperBounds().accept(new TypeDescription.Generic.Visitor.Substitutor.ForDetachment(matcher)), typeVariable.getDeclaredAnnotations()); }
/** * Returns a new detachment visitor that detaches any type matching the supplied type description. * * @param typeDefinition The type to detach. * @return A detachment visitor for the supplied type description. */ public static Visitor<Generic> of(TypeDefinition typeDefinition) { return new ForDetachment(is(typeDefinition)); }