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 SummaryFieldsModifier and TypeFieldDescriptionprotected final @NonNull io.micronaut.inject.ast.MethodElementprotected final @NonNull io.micronaut.inject.ast.ParameterElement[]protected final io.micronaut.inject.ast.ClassElementprotected final @NonNull io.micronaut.inject.visitor.VisitorContextFields inherited from interface io.micronaut.core.annotation.AnnotationSourceEMPTY
- 
Method SummaryModifier and TypeMethodDescriptionvoidFail compilation with the given message for the current method.io.micronaut.core.annotation.AnnotationMetadataMap<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.VisitorContextbooleanIs there a current error.booleanAre there possible failures.booleanisTypeInRole(@NonNull io.micronaut.inject.ast.ClassElement type, @NonNull String role) Check whether the given type performs the given role.voidLog any possible failures.voidpossiblyFail(@NonNull String message) Add a message that indicates a given finder failed.booleanWhether implicit queries such as lookup by id and counting is supported without an explicit query.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProviderfindAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.annotation.AnnotationSourcegetAnnotation, 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
- 
returnTypeprotected final io.micronaut.inject.ast.ClassElement returnType
- 
parameters@NonNull protected final @NonNull io.micronaut.inject.ast.ParameterElement[] parameters
 
- 
- 
Method Details- 
getQueryBuilder- Returns:
- The active query builder
 
- 
getAnnotationMetadatapublic io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
- getAnnotationMetadatain interface- io.micronaut.core.annotation.AnnotationMetadataProvider
 
- 
isTypeInRolepublic 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
 
- 
failFail compilation with the given message for the current method.- Parameters:
- message- The message
 
- 
possiblyFailAdd 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
 
- 
isFailingpublic boolean isFailing()Is there a current error.- Returns:
- True if there is an error
 
- 
isPossiblyFailingpublic boolean isPossiblyFailing()Are there possible failures.- Returns:
- True if there is an error
 
- 
logPossibleFailurespublic void logPossibleFailures()Log any possible failures.
- 
supportsImplicitQueriespublic 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- Returns:
- The message to print in the case of no possible implementations.
 
- 
getFindInterceptors- Returns:
- The find interceptors
 
 
-