Interface ViewpointAdapter
- All Known Implementing Classes:
AbstractViewpointAdapter
public interface ViewpointAdapter
A viewpoint adapter.
Viewpoint adaptation applies to member/field accesses, constructor invocations, method invocations, and type parameter bound instantiations.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
viewpointAdaptConstructor
(AnnotatedTypeMirror receiverType, ExecutableElement constructorElt, AnnotatedTypeMirror.AnnotatedExecutableType constructorType) Viewpoint adapts a constructor invocation.void
viewpointAdaptMember
(AnnotatedTypeMirror receiverType, Element memberElement, AnnotatedTypeMirror memberType) Viewpoint adapts a member/field access.void
viewpointAdaptMethod
(AnnotatedTypeMirror receiverType, ExecutableElement methodElt, AnnotatedTypeMirror.AnnotatedExecutableType methodType) Viewpoint adapts a method invocation.void
viewpointAdaptTypeParameterBounds
(AnnotatedTypeMirror receiverType, List<AnnotatedTypeParameterBounds> typeParameterBounds) Viewpoint adapts a type parameter bound when being instantiated.
-
Method Details
-
viewpointAdaptMember
void viewpointAdaptMember(AnnotatedTypeMirror receiverType, Element memberElement, AnnotatedTypeMirror memberType) Viewpoint adapts a member/field access.Developer notes: When this method is invoked on a member/field with a type given by a type parameter, the type arguments are correctly substituted, and memberType is already in a good shape. Only annotations on the memberType should be replaced by the viewpoint adapted ones.
- Parameters:
receiverType
- receiver type through which the member/field is accessed.memberElement
- element of the accessed member/field.memberType
- accessed type of the member/field. After the method returns, it will be mutated to the viewpoint adapted result.
-
viewpointAdaptConstructor
void viewpointAdaptConstructor(AnnotatedTypeMirror receiverType, ExecutableElement constructorElt, AnnotatedTypeMirror.AnnotatedExecutableType constructorType) Viewpoint adapts a constructor invocation. Takes an unsubstituted method invocation type and performs the viewpoint adaption in place, modifying the parameter.- Parameters:
receiverType
- receiver type through which a constructor is invoked.constructorElt
- element of the invoked constructor.constructorType
- invoked type of the constructor with type variables not substituted. After the method returns, it will be mutated to the viewpoint adapted constructor type.
-
viewpointAdaptMethod
void viewpointAdaptMethod(AnnotatedTypeMirror receiverType, ExecutableElement methodElt, AnnotatedTypeMirror.AnnotatedExecutableType methodType) Viewpoint adapts a method invocation. Takes an unsubstituted method invocation type and performs the viewpoint adaption in place, modifying the parameter.- Parameters:
receiverType
- receiver type through which a method is invoked.methodElt
- element of the invoked method. Only used to determine whether this type should be viewpoint adaptedmethodType
- invoked type of the method with type variables not substituted. After the method returns, it will be mutated to the viewpoint adapted method type.
-
viewpointAdaptTypeParameterBounds
void viewpointAdaptTypeParameterBounds(AnnotatedTypeMirror receiverType, List<AnnotatedTypeParameterBounds> typeParameterBounds) Viewpoint adapts a type parameter bound when being instantiated.- Parameters:
receiverType
- receiver type through which the type parameter is instantiated.typeParameterBounds
- a list of type parameter bounds. After the method returns, it will be mutated to the viewpoint adapted type parameter bounds.
-