Class JctFileManagerConfigurerChain

java.lang.Object
io.github.ascopes.jct.filemanagers.config.JctFileManagerConfigurerChain

public final class JctFileManagerConfigurerChain extends Object
A collection representing a chain of configurers to apply to a file manager.

This is used to provide a set of ordered configuration operations to perform on newly created file managers to prepare them for consumption in test cases. Common operations may include:

  • Automatically configuring the annotation processor paths;
  • Creating empty locations to prevent compilers raising exceptions;
  • Installing logging interceptors.

When configuring a file manager with this chain, each configurer is invoked in the provided order. Configurers themselves must return a file manager as a result of the configure operation. This operation may return the input file manager if the operation mutated the input, or it may return a different file manager instance. In the latter case, subsequent configuration operations internally will use the new file manager. The last returned file manager in the chain will be used as the final returned result. This enables configurers to wrap file managers in proxies or delegating implementations to intercept or override existing behaviours.

This class is not thread-safe.

Since:
0.0.1
Author:
Ashley Scopes