Interface Factory.Configuration

Enclosing class:
Factory

public static interface Factory.Configuration
Interface of factory configuration settings.
  • Method Details

    • isCapturingCallerLocations

      boolean isCapturingCallerLocations()
      Checks whether this factory shall capture the construction call location in client code.
      Returns:
      true if objects constructed by this factory record a location of the client code that called the factory; false if callers are not tracked.
    • getCreationWatcher

      @Opt Consumer<Object> getCreationWatcher()
      Returns the callback object that is notified of each created object.
      Returns:
      the callback object that is notified of each parser created by this factory, or null if no notification takes place.
    • getServiceFilter

      Predicate<StackTraceElement> getServiceFilter()
      Returns the function object that discerns between code pertaining to the parser construction service, and its client.
      Returns:
      a function object that returns true for a stack trace element that belongs to the parser construction service, or false if it belongs to the client
    • getGlobalPragmas

      Collection<Parser.Pragma> getGlobalPragmas()
      Returns the parsing pragmas that are in effect globally.
      Returns:
      an unmodifiable collection of the parsing pragmas that are in effect globally
    • withCapturingCallerLocations

      default Factory.Configuration withCapturingCallerLocations()
      Returns a variant of this configuration with capturing of caller locations enabled.
      Returns:
      a variant of this configuration with capturing of caller locations enabled
    • withCapturingCallerLocations

      default Factory.Configuration withCapturingCallerLocations(boolean capturingCallerLocations)
      Returns a variant of this configuration with capturing of caller locations enabled or disabled.
      Parameters:
      capturingCallerLocations - true for enabling, false for disabling capturing
      Returns:
      a variant of this configuration with capturing of caller locations modified
    • withCreationWatcher

      default Factory.Configuration withCreationWatcher(@Opt Consumer<Object> creationWatcher)
      Returns a variant of this configuration with the given creation watcher callback.
      Parameters:
      creationWatcher - the new creation watcher callback, or null to disable creation watching
      Returns:
      a variant of this configuration with the given creation watcher callback
      See Also:
    • withModuleAwareServiceFilter

      default Factory.Configuration withModuleAwareServiceFilter()
      Returns a variant of this configuration with stack trace elements distinguished by module membership.
      Returns:
      a variant of this configuration with stack trace elements distinguished by module membership
      See Also:
    • withGlobalPragmas

      default Factory.Configuration withGlobalPragmas(Parser.Pragma... pragmas)
      Returns a variant of this configuration with just the given global parsing pragmas. Global pragmas in effect for this configuration are not inherited by the result.
      Parameters:
      pragmas - the parsing pragmas that should be in effect globally
      Returns:
      a variant of this configuration with the given global parsing pragmas
      Throws:
      NullPointerException - if pragmas is or contains null
      See Also:
    • withAddedGlobalPragmas

      default Factory.Configuration withAddedGlobalPragmas(Parser.Pragma... pragmas)
      Returns a variant of this configuration with also the given global parsing pragmas. Global pragmas in effect for this configuration are inherited by the result.
      Parameters:
      pragmas - the parsing pragmas that should be in effect globally, in addition to the ones for this configuration
      Returns:
      a variant of this configuration with the given global parsing pragmas
      Throws:
      NullPointerException - if pragmas is or contains null
      See Also: