Class ParsingContext.Builder
java.lang.Object
org.glassfish.hk2.classmodel.reflect.ParsingContext.Builder
- Enclosing class:
ParsingContext
Context builder
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ArchiveSelector
(package private) ParsingConfig
(package private) ExecutorService
(package private) ResourceLocator
(package private) Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarchiveSelector
(ArchiveSelector selector) Sets the archive selector that can selects which jar should be parsed during the parsing activity.build()
Build the final ParsingContext with the provided configuration.config
(ParsingConfig config) Sets the parsing config that can be used to select which types should be exhaustively visited (fields + methods visits) or not.executorService
(ExecutorService service) Sets the executor service to be used to spawn threads during the parsing activity.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()
Returns the configured or default logger for the class-model library.Sets the logger to be used during the parsing activity.
-
Field Details
-
logger
Logger logger -
executorService
ExecutorService executorService -
archiveSelector
ArchiveSelector archiveSelector -
config
ParsingConfig config -
locator
ResourceLocator locator
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
Sets the logger to be used during the parsing activity.- Parameters:
logger
- a logger instance- Returns:
- itself
-
executorService
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
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
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
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
Build the final ParsingContext with the provided configuration.- Returns:
- the @{link ParsingContext} instance
-