Package uno.anahata.ai.nb.util


package uno.anahata.ai.nb.util
This package contains utility classes that provide helper functions and bridge various NetBeans Platform APIs for use by the plugin's core components and tools. These classes handle low-level, cross-cutting concerns, simplifying the logic in other parts of the plugin.

Key Utilities:

  • NetBeansModuleUtils: A critical utility responsible for introspecting the NetBeans module system. Its primary role is to dynamically construct a complete classpath at runtime, including all plugin dependencies, which is then injected into the RunningJVM tool to enable in-process compilation and execution.
  • NetBeansJavaQueryUtils: Provides helper methods that leverage the NetBeans Java Queries API (org.netbeans.api.java.queries) to find the source file (FileObject) for a given fully qualified class name, searching across all registered classpaths (project source, dependencies, and JDK).
  • ClassPathBuilder: A simple utility for converting a collection of File objects into a properly formatted classpath string.
  • TeeInputOutput: An implementation of the NetBeans InputOutput interface that acts as a "tee," duplicating all output sent to it to both the original delegate (e.g., the Output Window) and an in-memory buffer. This allows the AI to capture and analyze the output of processes it initiates.
  • Classes
    Class
    Description
    Utility class for building and managing classpaths within the NetBeans environment.
    A Jackson module that provides custom serialization and deserialization for NetBeans ElementHandle.
     
    Utility class for introspecting modules and their classpaths.