Interface Resources


public interface Resources
Represents collection of registered binds
  • Method Details

    • on

      Bind<?> on(Class<?> associatedType)
      Create bind for the specified type
      Parameters:
      associatedType - type to bind
      Returns:
      the bind based on an associated type
    • annotatedWith

      <A extends Annotation> Bind<A> annotatedWith(Class<A> annotation)
      Create bind for parameters annotated with the specified annotation
      Type Parameters:
      A - type of annotation
      Parameters:
      annotation - the annotation to bind
      Returns:
      the bind based on associated annotation
    • annotatedWithTested

      default <A extends Annotation> Bind<A> annotatedWithTested(Class<A> annotation)
      Create bind for parameters annotated with the specified annotation tested by the DependencyInjectionUtils.testAnnotation(Class) method
      Type Parameters:
      A - type of annotation
      Parameters:
      annotation - the annotation to bind
      Returns:
      the bind based on associated annotation
    • processType

      <V, R, E extends Exception> void processType(Class<V> associatedType, ThrowingTriFunction<Property,V,Object[],R,E> processor)
      Process injected object of the given type
      Type Parameters:
      V - type of value to process
      R - return type
      E - type of thrown exception
      Parameters:
      associatedType - type to process
      processor - the processor
    • processAnnotated

      <A extends Annotation, V, R, E extends Exception> void processAnnotated(Class<A> annotationType, ThrowingQuadFunction<A,Property,V,Object[],R,E> processor)
      Process injected object annotated with the given annotation
      Type Parameters:
      A - type of annotation to process
      V - type of the injected value
      R - return type
      E - type of thrown exception
      Parameters:
      annotationType - the annotation to handle
      processor - the processor
    • processAnnotatedType

      <A extends Annotation, V, R, E extends Exception> void processAnnotatedType(Class<A> annotationType, Class<V> type, ThrowingQuadFunction<A,Property,V,Object[],R,E> processor)
      Process injected of the given type and annotated with the given annotation
      Type Parameters:
      A - type of annotation to process
      V - type of the injected value
      R - return type
      E - type of thrown exception
      Parameters:
      annotationType - the annotation to handle
      type - the type to handle
      processor - the processor
    • fetchAnnotations

      Annotation[] fetchAnnotations(Parameter parameter)
      Fetch annotations assigned to the given parameter
      Parameters:
      parameter - the parameter to process
      Returns:
      annotations assigned to the executable parameters
    • fetchAnnotations

      Annotation[][] fetchAnnotations(Executable executable)
      Fetch annotations assigned to the given executable
      Parameters:
      executable - the executable to process
      Returns:
      annotations assigned to the executable parameters
    • getHandler

      Collection<org.panda_lang.utilities.inject.BindHandler<Annotation,Object,?>> getHandler(Parameter parameter)
      Get bind for the given parameter
      Parameters:
      parameter - the parameter to get bind for
      Returns:
      the associated bind
    • getBind

      Option<Bind<Annotation>> getBind(Class<?> requestedType)
      Get bind for the specified type or annotation
      Parameters:
      requestedType - the associated class with bind to search for
      Returns:
      the wrapped bind
    • fork

      Resources fork()
      Create a fork of resources. The current resources will be used as a parent of a new instance.
      Returns:
      a forked instance of resources
    • duplicate

      Resources duplicate()
      Duplicate (clone) resources
      Returns:
      a duplicated instance of resources