public static FunctionMapper newFunctionMapper ( ) { ServiceLoader < FunctionMapperSpi > loader = loadFunctionMapperSpi ( ) ; // load FunctionMapperSpi instances ConcurrentMap < String , FunctionMapperSpi > functionMappers = new ConcurrentHashMap <> ( ) ; for ( FunctionMapperSpi functionMapperSpi : loader ) { String prefixName = functionMapperSpi . getPrefixName ( ) ; FunctionMapperSpi oldFunctionMapperSpi = functionMappers . putIfAbsent ( prefixName , functionMapperSpi ) ; if ( oldFunctionMapperSpi != null ) { throw new ELException ( String . format ( "Duplicate prefix function mapper: %s" , prefixName ) ) ; } } return new FunctionMapper ( functionMappers ) ; }
Creates a new Function Mapper .