Interface MethodMirror.TypeWalker

Enclosing interface:
MethodMirror

public static interface MethodMirror.TypeWalker
Controller for accessing the reflected methods of a given type
  • Method Details

    • getEnclosingType

      @NonNull ReifiedType.Annotated getEnclosingType()
      Gets the type which this TypeWalker is looking at
      Returns:
      the type
    • getViableMethods

      @NonNull Stream<@NonNull MethodId> getViableMethods()
      Gets all accessible, non-inherited, instance methods declared in this type.

      However the returned stream is ordered, that order will later determine the order of serializing data entries. There is no need for the implementation to skip source-level covariant overides, since these will be handled by the caller, but bridge and synthetic methods do need to be skipped.

      Generic values must be fully reified. The passed type information provides the reified type arguments that can help with this.

      Returns:
      a stream of methods
    • getAnnotations

      @NonNull AnnotatedElement getAnnotations(@NonNull MethodId methodId)
      Gets annotations present on the specified method.

      The method must be taken from getViableMethods(), meaning it must be accessible and located in the type this TypeWalker is made for. This function is permitted to assume this precondition and may behave unexpectedly if it is not met.

      Parameters:
      methodId - the method
      Returns:
      the annotations on this method
    • getSuperTypes

      @NonNull MethodMirror.TypeWalker @NonNull [] getSuperTypes()
      Moves to the directly declared super types of this type
      Returns:
      the super types