Search in sources :

Example 1 with ResourceFilterDirectoryImpl

use of io.crnk.core.module.internal.ResourceFilterDirectoryImpl in project crnk-framework by crnk-project.

the class ModuleRegistry method init.

/**
 * Initializes the {@link ModuleRegistry} and applies all pending changes.
 * After the initialization completed, it is not possible to add any further
 * modules.
 *
 * @param objectMapper object mapper
 */
public void init(ObjectMapper objectMapper) {
    PreconditionUtil.assertEquals("already initialized", InitializedState.NOT_INITIALIZED, initializedState);
    this.initializedState = InitializedState.INITIALIZING;
    this.objectMapper = objectMapper;
    this.objectMapper.registerModules(getJacksonModules());
    initializeModules();
    applyRepositoryRegistrations();
    ExceptionMapperLookup exceptionMapperLookup = getExceptionMapperLookup();
    ExceptionMapperRegistryBuilder mapperRegistryBuilder = new ExceptionMapperRegistryBuilder();
    exceptionMapperRegistry = mapperRegistryBuilder.build(exceptionMapperLookup);
    filterBehaviorProvider = new ResourceFilterDirectoryImpl(aggregatedModule.getResourceFilters(), httpRequestContextProvider, resourceRegistry);
    this.initializedState = InitializedState.INITIALIZED;
}
Also used : ExceptionMapperLookup(io.crnk.core.engine.internal.exception.ExceptionMapperLookup) ResourceFilterDirectoryImpl(io.crnk.core.module.internal.ResourceFilterDirectoryImpl) ExceptionMapperRegistryBuilder(io.crnk.core.engine.internal.exception.ExceptionMapperRegistryBuilder)

Aggregations

ExceptionMapperLookup (io.crnk.core.engine.internal.exception.ExceptionMapperLookup)1 ExceptionMapperRegistryBuilder (io.crnk.core.engine.internal.exception.ExceptionMapperRegistryBuilder)1 ResourceFilterDirectoryImpl (io.crnk.core.module.internal.ResourceFilterDirectoryImpl)1