Class MatchContext

java.lang.Object
io.micronaut.data.processor.visitors.MatchContext
All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource
Direct Known Subclasses:
MethodMatchContext

public class MatchContext extends Object implements io.micronaut.core.annotation.AnnotationMetadataProvider
A match context when matching methods.
Since:
1.0.0
Author:
graemerocher
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final @NonNull io.micronaut.inject.ast.MethodElement
     
    protected final @NonNull io.micronaut.inject.ast.ParameterElement[]
     
    protected final io.micronaut.inject.ast.ClassElement
     
    protected final Map<String,String>
     
    protected final @NonNull io.micronaut.inject.visitor.VisitorContext
     

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fail(@NonNull String message)
    Fail compilation with the given message for the current method.
    io.micronaut.core.annotation.AnnotationMetadata
     
    Map<io.micronaut.inject.ast.ClassElement,FindInterceptorDef>
     
    @NonNull io.micronaut.inject.ast.MethodElement
     
    @NonNull io.micronaut.inject.ast.ParameterElement[]
     
     
    @NonNull io.micronaut.inject.ast.ClassElement
     
    @NonNull io.micronaut.inject.ast.ClassElement
     
     
    @NonNull io.micronaut.inject.visitor.VisitorContext
     
    boolean
    Is there a current error.
    boolean
    Are there possible failures.
    boolean
    isTypeInRole(@NonNull io.micronaut.inject.ast.ClassElement type, @NonNull String role)
    Check whether the given type performs the given role.
    void
    Log any possible failures.
    void
    possiblyFail(@NonNull String message)
    Add a message that indicates a given finder failed.
    boolean
    Whether implicit queries such as lookup by id and counting is supported without an explicit query.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationSource

    getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
  • Field Details

    • visitorContext

      @NonNull protected final @NonNull io.micronaut.inject.visitor.VisitorContext visitorContext
    • methodElement

      @NonNull protected final @NonNull io.micronaut.inject.ast.MethodElement methodElement
    • typeRoles

      protected final Map<String,String> typeRoles
    • returnType

      protected final io.micronaut.inject.ast.ClassElement returnType
    • parameters

      @NonNull protected final @NonNull io.micronaut.inject.ast.ParameterElement[] parameters
  • Method Details

    • getQueryBuilder

      public QueryBuilder getQueryBuilder()
      Returns:
      The active query builder
    • getAnnotationMetadata

      public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
      Specified by:
      getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
    • isTypeInRole

      public boolean isTypeInRole(@NonNull @NonNull io.micronaut.inject.ast.ClassElement type, @NonNull @NonNull String role)
      Check whether the given type performs the given role.
      Parameters:
      type - The type
      role - The role
      Returns:
      True if it is
    • getVisitorContext

      @NonNull public @NonNull io.micronaut.inject.visitor.VisitorContext getVisitorContext()
      Returns:
      The visitor context
    • getMethodElement

      @NonNull public @NonNull io.micronaut.inject.ast.MethodElement getMethodElement()
      Returns:
      The method element
    • getReturnType

      @NonNull public @NonNull io.micronaut.inject.ast.ClassElement getReturnType()
      Returns:
      The return type
    • getParameters

      @NonNull public @NonNull io.micronaut.inject.ast.ParameterElement[] getParameters()
      Returns:
      The parameters
    • fail

      public void fail(@NonNull @NonNull String message)
      Fail compilation with the given message for the current method.
      Parameters:
      message - The message
    • possiblyFail

      public void possiblyFail(@NonNull @NonNull String message)
      Add a message that indicates a given finder failed. This should only be used if a finder matches a method, but some additional requirement is not met. This leaves the possibility that another finder may match the method and proceed successfully. Possible failures will only be logged if the method could not be implemented.
      Parameters:
      message - The message
    • isFailing

      public boolean isFailing()
      Is there a current error.
      Returns:
      True if there is an error
    • isPossiblyFailing

      public boolean isPossiblyFailing()
      Are there possible failures.
      Returns:
      True if there is an error
    • logPossibleFailures

      public void logPossibleFailures()
      Log any possible failures.
    • supportsImplicitQueries

      public boolean supportsImplicitQueries()
      Whether implicit queries such as lookup by id and counting is supported without an explicit query.
      Returns:
      True if it is
    • getRepositoryClass

      @NonNull public @NonNull io.micronaut.inject.ast.ClassElement getRepositoryClass()
      Returns:
      The repository class.
    • getUnableToImplementMessage

      public String getUnableToImplementMessage()
      Returns:
      The message to print in the case of no possible implementations.
    • getFindInterceptors

      public Map<io.micronaut.inject.ast.ClassElement,FindInterceptorDef> getFindInterceptors()
      Returns:
      The find interceptors