Package org.eclipse.sisu.inject.RankedBindingsTest

Examples of org.eclipse.sisu.inject.RankedBindingsTest.BeanImpl


            {
                bind( Bean.class ).to( BeanImpl.class ); // also seen as @Named("default")

                bind( Bean.class ).annotatedWith( Named.class ).to( BeanImpl.class ); // only in unrestricted search

                bind( Bean.class ).annotatedWith( Names.named( "Named1" ) ).toProvider( Providers.of( new BeanImpl() ) );
                bind( Bean.class ).annotatedWith( Names.named( "Named2" ) ).to( BeanImpl.class );

                bind( Bean.class ).annotatedWith( Marked.class ).to( BeanImpl.class ); // only in unrestricted search

                bind( Bean.class ).annotatedWith( MarkedBeanImpl1.class.getAnnotation( Marked.class ) ).to( MarkedBeanImpl1.class );
View Full Code Here


                {
                    public String getDescription()
                    {
                        return "Another test";
                    }
                } ).bind( key2 ).toInstance( new BeanImpl() );

                binder().withSource( "where?" ).bind( key3 ).to( BeanImpl.class );

                bind( key4 ).toProvider( Providers.of( new BeanImpl() ) );
            }
        } );

        final LazyBeanEntry<Annotation, Bean> bean1 =
            new LazyBeanEntry<Annotation, Bean>( key1.getAnnotation(), injector.getBinding( key1 ), 42 );
View Full Code Here

                }
                catch ( final NoSuchMethodException e )
                {
                }

                bind( Bean.class ).annotatedWith( Names.named( "instance" ) ).toInstance( new BeanImpl() );

                bind( Bean.class ).annotatedWith( Names.named( "deferred" ) ).toProvider( new LoadedClass<Bean>(
                                                                                                                 BeanImpl.class ) );

                install( new PrivateModule()
                {
                    @Override
                    protected void configure()
                    {
                        bind( Bean.class ).annotatedWith( Names.named( "exposed" ) ).to( BeanImpl.class );
                        expose( Bean.class ).annotatedWith( Names.named( "exposed" ) );
                    }
                } );

                bind( Bean.class ).annotatedWith( Names.named( "provider" ) ).toProvider( Providers.of( new BeanImpl() ) );

                bind( Bean.class ).annotatedWith( Names.named( "broken" ) ).toProvider( new DeferredProvider<Bean>()
                {
                    public Bean get()
                    {
View Full Code Here

TOP

Related Classes of org.eclipse.sisu.inject.RankedBindingsTest.BeanImpl

Copyright © 2018 www.massapicom. 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.