Record Class PythonProcessingEnvironment

java.lang.Object
java.lang.Record
io.micronaut.python.processing.PythonProcessingEnvironment
Record Components:
environment - The underlying Python environment containing classes and decorators.
annotationMetadataBuilder - The builder for creating annotation metadata from Python elements.
metadataFactory - The factory for creating element annotation metadata.
javaVisitorContext - The backing Java visitor context.
visitorContext - The visitor context for processing Python elements.
originatingElement - The Java element that triggered Python processing.
classesCache - The per-processing-run class element cache.
scriptsCache - The per-processing-run script element cache.
All Implemented Interfaces:
AutoCloseable

public record PythonProcessingEnvironment(PythonEnvironment environment, PythonAnnotationMetadataBuilder annotationMetadataBuilder, PythonElementAnnotationMetadataFactory metadataFactory, JavaVisitorContext javaVisitorContext, PythonVisitorContext visitorContext, Element originatingElement, AtomicReference<Map<String, ClassElement>> classesCache, AtomicReference<Map<String, ClassElement>> scriptsCache) extends Record implements AutoCloseable
Represents a Python processing environment that extends the basic Python environment with additional processing capabilities for annotation metadata and visitor context. This record is used during Micronaut's annotation processing phase to handle Python code integration.
Since:
5.2.0
Author:
Micronaut
  • Constructor Details

  • Method Details

    • close

      public void close()
      Closes the Python processing environment by closing the underlying Python environment.
      Specified by:
      close in interface AutoCloseable
    • classes

      public Map<String, ClassElement> classes()
      Returns a map of Python class elements, converting the raw class definitions into processing-ready elements with annotation metadata support.
      Returns:
      A map of class names to Python class elements.
    • scripts

      public Map<String, ClassElement> scripts()
      Returns a map of Python script elements, converting the raw script definitions into processing-ready elements with annotation metadata support.
      Returns:
      A map of script names to Python script elements.
    • scriptsIfInitialized

      public Map<String, ClassElement> scriptsIfInitialized()
      Returns the script element cache without initializing it.
      Returns:
      The cached script elements, or null if scripts have not been initialized yet.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • environment

      public PythonEnvironment environment()
      Returns the value of the environment record component.
      Returns:
      the value of the environment record component
    • annotationMetadataBuilder

      public PythonAnnotationMetadataBuilder annotationMetadataBuilder()
      Returns the value of the annotationMetadataBuilder record component.
      Returns:
      the value of the annotationMetadataBuilder record component
    • metadataFactory

      public PythonElementAnnotationMetadataFactory metadataFactory()
      Returns the value of the metadataFactory record component.
      Returns:
      the value of the metadataFactory record component
    • javaVisitorContext

      public JavaVisitorContext javaVisitorContext()
      Returns the value of the javaVisitorContext record component.
      Returns:
      the value of the javaVisitorContext record component
    • visitorContext

      public PythonVisitorContext visitorContext()
      Returns the value of the visitorContext record component.
      Returns:
      the value of the visitorContext record component
    • originatingElement

      public Element originatingElement()
      Returns the value of the originatingElement record component.
      Returns:
      the value of the originatingElement record component
    • classesCache

      public AtomicReference<Map<String, ClassElement>> classesCache()
      Returns the value of the classesCache record component.
      Returns:
      the value of the classesCache record component
    • scriptsCache

      public AtomicReference<Map<String, ClassElement>> scriptsCache()
      Returns the value of the scriptsCache record component.
      Returns:
      the value of the scriptsCache record component