org.glassfish.hk2.classmodel.reflect
Class ParsingContext.Builder

java.lang.Object
  extended by org.glassfish.hk2.classmodel.reflect.ParsingContext.Builder
Enclosing class:
ParsingContext

public static class ParsingContext.Builder
extends Object

Context builder


Constructor Summary
ParsingContext.Builder()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsingContext.Builder

public ParsingContext.Builder()
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 the ResourceLocator 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


Copyright © 2013 Oracle Corporation. All Rights Reserved.