Class PackageScanner

java.lang.Object
dev.relism.flash.extension.PackageScanner

public final class PackageScanner extends Object
Minimal classpath scanner used by FlashRegistrar.scan(java.lang.String) and FlashRegistrar.scan(java.lang.String). Finds RequestHandler subclasses in a package that carry a routing annotation (
invalid reference
@Route
or shorthand @GET, @POST, …). Supports both exploded directories (development) and fat JARs (deployment).

Fail-fast: if the package does not exist, contains no handlers, or a handler class cannot be loaded, an InitializationException is thrown immediately. A clear crash at boot is always preferable to a server that starts "empty".

  • Method Details

    • discover

      public static List<Class<?>> discover(String packageName)
      Shared deterministic classpath discovery primitive for Flash extensions. It owns the directory/JAR traversal, anonymous-class exclusion and load diagnostics; extensions only classify the returned classes according to their own component contract.