@ PostConstruct @ SuppressWarnings ( "unchecked" ) protected void configure ( ) { // scan all fields for ( Field field : getClass ( ) . getDeclaredFields ( ) ) { // if it's a preprocessor, register it if ( IModifier . class . isAssignableFrom ( field . getType ( ) ) ) { try { field . setAccessible ( true ) ; final IModifier processor = ( IModifier ) field . get ( this ) ; processorsCache . put ( processor . getAnnotationType ( ) , processor ) ; } catch ( IllegalArgumentException | IllegalAccessException ex ) { LoggerFactory . getLogger ( ModifiersPreprocessor . class ) . error ( "Could not register pre-processor for field " + field . getName ( ) ) ; } } } }
Registers all preprocessors injected into this class .