Class ModelPostProcessorRegistry
java.lang.Object
com.foursoft.harness.navext.runtime.postprocessing.ModelPostProcessorRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDefaultPostProcessor(ModelPostProcessor postProcessor) Adds a default post processor.voidClear the state of allModelPostProcessorcurrently registered, to allow garbage collection and reuse during multiple unmarshallings.<T extends ModelPostProcessor>
List<T>findModelPostProcessors(Class<T> postProcessorType) Finds all registered defaultModelPostProcessors that are an instance of postProcessorType.postProcessorsFor(Class<?> classToHandle) Retrieves a list of allModelPostProcessorthat are registered in this registry and that are applicable for classToHandle.withFactory(Function<Class<?>, ModelPostProcessor> modelPostProcessorFactory) Register a factory function that is called once for each class to create an individualModelPostProcessorinstance for the given class.
-
Constructor Details
-
ModelPostProcessorRegistry
-
-
Method Details
-
withFactory
public ModelPostProcessorRegistry withFactory(Function<Class<?>, ModelPostProcessor> modelPostProcessorFactory) Register a factory function that is called once for each class to create an individualModelPostProcessorinstance for the given class. TheModelPostProcessorshall handle the necessary aspects of the given class only, for inherited aspects of super classes an individualModelPostProcessoris created.- Parameters:
modelPostProcessorFactory- a function providing a special post processor per class- Returns:
- this for fluent API
-
clearStateOfPostProcessors
public void clearStateOfPostProcessors()Clear the state of allModelPostProcessorcurrently registered, to allow garbage collection and reuse during multiple unmarshallings.- See Also:
-
findModelPostProcessors
Finds all registered defaultModelPostProcessors that are an instance of postProcessorType.- Type Parameters:
T- the type of processors to look for- Parameters:
postProcessorType- the class of the post processors to find- Returns:
- the list of processor of the given type. Can be empty - never null.
-
postProcessorsFor
Retrieves a list of allModelPostProcessorthat are registered in this registry and that are applicable for classToHandle.Applicable
ModelPostProcessors are basically all that satisfy the interface and can handle the given class.ModelPostProcessor.getClassToHandle().isAssignableFrom(classToHandle).- Parameters:
classToHandle- the class to processor- Returns:
- the list of post processors found for the given class.