Interface ProcessingContext


public interface ProcessingContext
This interface defines the context for the annotation procesing handler. There is only one context instance per AnnotationProcessor invocation.
Author:
Jerome Dochez
  • Method Summary

    Modifier and Type
    Method
    Description
    org.glassfish.api.deployment.archive.ReadableArchive
    Returns the module archive that can be used to load files/resources, that assist in the processing of annotations.
    Return the error handler for this processing context.
    Return the current handler (if any) receving all the annotated elements start and stop events.
    Returns the Scanner implementation which is responsible for providing access to all the .class files the processing tool needs to scan.
    Returns the AnnotationProcessor instance this context is associated with.
    Removes the top handler
    void
    Push a new handler on the stack of handlers.
    void
    setArchive(org.glassfish.api.deployment.archive.ReadableArchive archive)
     
    void
    Sets the ErrorHandler instance for all errors/warnings that may be raised during the annotation processing.
    void
    Sets the Scanner implementation which is responsible for accessing all the .class files the AnnotationProcessor should process.
  • Method Details

    • getProcessor

      AnnotationProcessor getProcessor()
      Returns the AnnotationProcessor instance this context is associated with.
      Returns:
      annotation processor instance
    • getProcessingInput

      Scanner getProcessingInput()
      Returns the Scanner implementation which is responsible for providing access to all the .class files the processing tool needs to scan.
      Returns:
      scanner instance
    • getArchive

      org.glassfish.api.deployment.archive.ReadableArchive getArchive()
      Returns the module archive that can be used to load files/resources, that assist in the processing of annotations. Using the ClassLoader is preferred, but not all files can be loaded by it and this can be handy in those cases.
      Returns:
      module archive
    • setArchive

      void setArchive(org.glassfish.api.deployment.archive.ReadableArchive archive)
    • setProcessingInput

      void setProcessingInput(Scanner scanner)
      Sets the Scanner implementation which is responsible for accessing all the .class files the AnnotationProcessor should process.
    • pushHandler

      void pushHandler(AnnotationContext handler)
      Push a new handler on the stack of handlers. This handler will receive all the AnnotedElementHandler events until it is removed from the stack with a popHandler() call.
      Parameters:
      handler - the new events handler.
    • getHandler

      Return the current handler (if any) receving all the annotated elements start and stop events.
      Returns:
      the top handler
    • popHandler

      Removes the top handler
      Returns:
      the removed handler
    • setErrorHandler

      void setErrorHandler(ErrorHandler errorHandler)
      Sets the ErrorHandler instance for all errors/warnings that may be raised during the annotation processing.
      Parameters:
      errorHandler - the annotation handler
    • getErrorHandler

      ErrorHandler getErrorHandler()
      Return the error handler for this processing context.
      Returns:
      the error handler