Interface MappingDiscoverer

All Known Implementing Classes:
AnnotationMappingDiscoverer, CachingMappingDiscoverer

public interface MappingDiscoverer
Strategy interface to discover a URI mapping and related Affordances for either a given type or method.
Author:
Oliver Gierke, Greg Turnquist, RĂ©da Housni Alaoui
  • Method Details

    • getMapping

      @Nullable @Deprecated String getMapping(Class<?> type)
      Deprecated.
      since 2.0, prefer getUriMapping(Class)
      Returns the mapping associated with the given type.
      Parameters:
      type - must not be null.
      Returns:
      the type-level mapping or null in case none is present.
    • getUriMapping

      @Nullable default UriMapping getUriMapping(Class<?> type)
      Returns the mapping associated with the given type.
      Parameters:
      type - must not be null.
      Returns:
      the type-level mapping or null in case none is present.
      Since:
      2.0
    • getMapping

      @Nullable @Deprecated String getMapping(Method method)
      Deprecated.
      since 2.0, use getUriMapping(Method) instead
      Returns the mapping associated with the given Method. This will include the type-level mapping.
      Parameters:
      method - must not be null.
      Returns:
      the method mapping including the type-level one or null if neither of them present.
    • getUriMapping

      @Nullable default UriMapping getUriMapping(Method method)
      Returns the mapping associated with the given Method. This will include the type-level mapping.
      Parameters:
      method - must not be null.
      Returns:
      the method mapping including the type-level one or null if neither of them present.
      Since:
      2.0
    • getMapping

      @Nullable @Deprecated String getMapping(Class<?> type, Method method)
      Deprecated.
      since 2.0, use getUriMapping(Class, Method) instead
      Returns the mapping for the given Method invoked on the given type. This can be used to calculate the mapping for a super type method being invoked on a sub-type with a type mapping.
      Parameters:
      type - must not be null.
      method - must not be null.
      Returns:
      the method mapping including the type-level one or null if neither of them present.
    • getUriMapping

      @Nullable default UriMapping getUriMapping(Class<?> type, Method method)
      Returns the mapping for the given Method invoked on the given type. This can be used to calculate the mapping for a super type method being invoked on a sub-type with a type mapping.
      Parameters:
      type - must not be null.
      method - must not be null.
      Returns:
      the method mapping including the type-level one or null if neither of them present.
      Since:
      2.0
    • getRequestMethod

      Collection<HttpMethod> getRequestMethod(Class<?> type, Method method)
      Returns the HTTP verbs for the given Method invoked on the given type. This can be used to build hypermedia templates.
      Parameters:
      type -
      method -
      Returns:
    • getConsumes

      List<MediaType> getConsumes(Method method)
      Returns the MediaTypes supported for consumption.
      Parameters:
      method - must not be null.
      Returns:
      can be null.
      Since:
      1.3
    • getParams

      String[] getParams(Method method)
      Returns the statically declared request parameters.
      Parameters:
      method - must not be null.
      Returns:
      the parameters of the mapped request, narrowing the primary mapping.
      Since:
      1.4