Interface MappingAnnotationProcessorContext

    • Method Detail

      • toBeanReference

        default <T> Optional<BeanReference<? extends T>> toBeanReference​(Class<T> expectedType,
                                                                         Class<?> undefinedTypeMarker,
                                                                         Class<? extends T> type,
                                                                         String name)
        Type Parameters:
        T - The bean type.
        Parameters:
        expectedType - The supertype of all types that can be referenced.
        undefinedTypeMarker - A marker type to detect that the type parameter has its default value (undefined).
        type - The bean type.
        name - The bean name.
        Returns:
        The corresponding bean reference, or an empty optional if neither the type nor the name is provided.
      • toBeanReference

        <T> Optional<BeanReference<? extends T>> toBeanReference​(Class<T> expectedType,
                                                                 Class<?> undefinedTypeMarker,
                                                                 Class<? extends T> type,
                                                                 String name,
                                                                 BeanRetrieval retrieval)
        Convert attributes of a bean-reference annotation, such as ValueBridgeRef, to an actual BeanReference.

        Example of use:

        
             Optional<BeanReference<? extends ValueBridge>> valueBridgeRef = toBeanReference(
                     ValueBridge.class,
                     ValueBridgeRef.UndefinedBridgeImplementationType.class,
                     myValueBridgeRefInstance.type(),
                     myValueBridgeRefInstance.name(),
                     myValueBridgeRefInstance.retrieval()
             );
         
        Type Parameters:
        T - The bean type.
        Parameters:
        expectedType - The supertype of all types that can be referenced.
        undefinedTypeMarker - A marker type to detect that the type parameter has its default value (undefined).
        type - The bean type.
        name - The bean name.
        retrieval - How to retrieve the bean. See BeanRetrieval.
        Returns:
        The corresponding bean reference, or an empty optional if neither the type nor the name is provided.
      • eventContext

        EventContext eventContext()
        Returns:
        An event context describing the annotation being processed and its location, for use in log messages and exception messages.