Class ParsingContext.Builder
- java.lang.Object
-
- org.glassfish.hk2.classmodel.reflect.ParsingContext.Builder
-
- Enclosing class:
- ParsingContext
public static class ParsingContext.Builder extends Object
Context builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParsingContext.Builder
archiveSelector(ArchiveSelector selector)
Sets the archive selector that can selects which jar should be parsed during the parsing activity.ParsingContext
build()
Build the final ParsingContext with the provided configuration.ParsingContext.Builder
config(ParsingConfig config)
Sets the parsing config that can be used to select which types should be exhaustively visited (fields + methods visits) or not.ParsingContext.Builder
executorService(ExecutorService service)
Sets the executor service to be used to spawn threads during the parsing activity.ParsingContext.Builder
locator(ResourceLocator locator)
Sets the resource locator that can be used to load and parse extra types that were referenced during the parsing but could not be parsed due to their absence from the input archive set.Logger
logger()
Returns the configured or default logger for the class-model library.ParsingContext.Builder
logger(Logger logger)
Sets the logger to be used during the parsing activity.
-
-
-
Method Detail
-
logger
public Logger logger()
Returns the configured or default logger for the class-model library.- Returns:
- the current logger associated with this builder, either
set using
logger(java.util.logging.Logger)
method, either using the default logger for this library.
-
logger
public ParsingContext.Builder logger(Logger logger)
Sets the logger to be used during the parsing activity.- Parameters:
logger
- a logger instance- Returns:
- itself
-
executorService
public ParsingContext.Builder executorService(ExecutorService service)
Sets the executor service to be used to spawn threads during the parsing activity. The parsing activity is an asynchronous process that can choose to spawn threads to handle sub part of the handling process.- Parameters:
service
- the executor service to be used during the parsing activity- Returns:
- itself
-
archiveSelector
public ParsingContext.Builder archiveSelector(ArchiveSelector selector)
Sets the archive selector that can selects which jar should be parsed during the parsing activity. This is particularly useful when the parser is configured to parse an entire directory of jars but only needs to actually parse those jars depending on some environmental condition or if the jar shows a particular stigma (like a jar entry existence).- Parameters:
selector
- the archive selector.- Returns:
- itself
-
locator
public ParsingContext.Builder locator(ResourceLocator locator)
Sets the resource locator that can be used to load and parse extra types that were referenced during the parsing but could not be parsed due to their absence from the input archive set. The parser will call theResourceLocator
to give a chance to the caller to selectively add such unvisited types to the parsing activity- Parameters:
locator
- a resource locator instance- Returns:
- itself
-
config
public ParsingContext.Builder config(ParsingConfig config)
Sets the parsing config that can be used to select which types should be exhaustively visited (fields + methods visits) or not.- Parameters:
config
- the config instance- Returns:
- itself
-
build
public ParsingContext build()
Build the final ParsingContext with the provided configuration.- Returns:
- the @{link ParsingContext} instance
-
-