Class GuiceChainrInstantiator
- java.lang.Object
-
- com.bazaarvoice.jolt.chainr.instantiator.GuiceChainrInstantiator
-
- All Implemented Interfaces:
ChainrInstantiator
public class GuiceChainrInstantiator extends java.lang.Object implements ChainrInstantiator
This class allows Transforms specified in Chainr spec files to be loaded via Guice. This is primarily used for Custom Java Transforms that need additional information. It requires a GuiceModule, because it creates an Injector for each SpecTransform it processes. If your app is using Guice, you can either pass in your "existing" Module (if you can), or create a Guice Module with just the dependencies that the Transforms require. The latter approach keeps scope contained, and make it easier to unit test your Transforms. Note this does require that you "know" what Transforms you are using and what they depend on.
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.inject.Injector
nonSpecInjector
private com.google.inject.Module
parentModule
-
Constructor Summary
Constructors Constructor Description GuiceChainrInstantiator(com.google.inject.Module parentModule)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoltTransform
hydrateTransform(ChainrEntry entry)
Instantiate the Transform class specified by the ChainrEntry.
-
-
-
Method Detail
-
hydrateTransform
public JoltTransform hydrateTransform(ChainrEntry entry)
Description copied from interface:ChainrInstantiator
Instantiate the Transform class specified by the ChainrEntry.- Specified by:
hydrateTransform
in interfaceChainrInstantiator
-
-