Package org.eclipse.sisu.inject

Examples of org.eclipse.sisu.inject.BeanLocator.locate()


    public static <T> T lookup( final Key<T> key )
    {
        final BeanLocator locator = getBeanLocator();
        if ( null != locator )
        {
            final Iterator<? extends Entry<?, T>> i = locator.locate( key ).iterator();
            if ( i.hasNext() )
            {
                return i.next().getValue();
            }
        }
View Full Code Here


                bind( ParameterKeys.PROPERTIES ).toInstance( Collections.singletonMap( "Hello", "world!" ) );
            }
        } ) ).getInstance( BeanLocator.class );

        @SuppressWarnings( { "rawtypes", "unchecked" } )
        final Iterator<Map<?, ?>> itr = new EntryListAdapter( locator.locate( ParameterKeys.PROPERTIES ) ).iterator();

        assertTrue( itr.hasNext() );

        final Map<?, ?> parameters = itr.next();
        assertEquals( 1, parameters.size() );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.