scan library

Annotations scanning library.

This library contains the annotations scanning functions, which allows the Server and ServerPipeline from the core library to automatically populated by scanning the application for Handles annotations. To use the scanning functions, import woomera.dart which includes both the core library and this scanning library. This scanning library requires the Dart Mirrors package.

Usage

See the core library for details on how to use Woomera.

This library defines two functions to create Server and ServerPipelines from annotations in the code: serverFromAnnotations and serverPipelineFromAnnotations. It also defines extra exceptions that can arise during the scanning operation.

Logging

The Logger package is used for logging. The available logger from this library is named:

  • woomera.handles - logs rules created via Handles annotations

Functions

dumpServer(Server server, {String functionName = 'serverBuilder', String libraryName = '', Iterable<String> importedLibraries = const <String>[], bool includeDartVersionComment = false, bool timestamp = true, bool locations = true, bool includeDumpServerStub = true}) String
Experimental function to dump a server that was created from annotations
serverFromAnnotations({Iterable<String>? pipelines, Iterable<String>? libraries, bool scanAllFileLibraries = true, bool ignoreUnusedAnnotations = false}) Server
Creates a Server and populates pipelines with rules from annotations.
serverPipelineFromAnnotations(String pipelineName, Iterable<String>? libraries, {bool scanAllFileLibraries = true}) ServerPipeline
Creates pipeline and populates it with rules from annotations.

Exceptions / Errors

BadHandlesPattern
Indicates the pattern to create a Handles object is invalid.
DuplicateExceptionHandler
Indicates a Handles annotation already exists for the exception handler.
DuplicateRuleWithExistingHandler
Attempt to register a duplicate rule in a pipeline.
LibraryNotFound
Library not found
NotExceptionHandler
Indicates an Handles annotation was place on the wrong type of function.
NotRequestHandler
Indicates an Handles annotation was place on the wrong type of function.