Examples of TypeContainer


Examples of com.github.jsr330.instance.TypeContainer

    @SuppressWarnings("unchecked")
    @Test
    public void andNonConfirming() {
        TypeConfig config = defaultBinder.instance(TestInterface.class).as(TestImplementation1.class).when((BindingCondition<TestInterface>) confirming)
                .and((BindingCondition<TestInterface>) nonConfirming).build();
        TypeContainer container;
       
        container = config.getTypeContainer(null, TestInterface.class, null, null, null);
        assertNull(container);
    }
View Full Code Here

Examples of com.github.jsr330.instance.TypeContainer

    @SuppressWarnings("unchecked")
    @Test
    public void orConfirming() {
        TypeConfig config = defaultBinder.instance(TestInterface.class).as(TestImplementation1.class).when((BindingCondition<TestInterface>) confirming)
                .or((BindingCondition<TestInterface>) confirming).build();
        TypeContainer container;
       
        container = config.getTypeContainer(null, TestInterface.class, null, null, null);
        assertNotNull(container);
        assertEquals(TestImplementation1.class, container.getType());
        assertFalse(container.isSingleton());
        assertEquals(InstanceMode.CONSTRUCTOR, container.getInstanceMode());
    }
View Full Code Here

Examples of com.github.jsr330.instance.TypeContainer

    @SuppressWarnings("unchecked")
    @Test
    public void orNonConfirming() {
        TypeConfig config = defaultBinder.instance(TestInterface.class).as(TestImplementation1.class).when((BindingCondition<TestInterface>) nonConfirming)
                .or((BindingCondition<TestInterface>) confirming).build();
        TypeContainer container;
       
        container = config.getTypeContainer(null, TestInterface.class, null, null, null);
        assertNotNull(container);
        assertEquals(TestImplementation1.class, container.getType());
        assertFalse(container.isSingleton());
        assertEquals(InstanceMode.CONSTRUCTOR, container.getInstanceMode());
    }
View Full Code Here

Examples of com.github.jsr330.instance.TypeContainer

    @SuppressWarnings("unchecked")
    @Test
    public void xorConfirming() {
        TypeConfig config = defaultBinder.instance(TestInterface.class).as(TestImplementation1.class).when((BindingCondition<TestInterface>) confirming)
                .xor((BindingCondition<TestInterface>) confirming).build();
        TypeContainer container;
       
        container = config.getTypeContainer(null, TestInterface.class, null, null, null);
        assertNull(container);
    }
View Full Code Here

Examples of com.github.jsr330.instance.TypeContainer

    @SuppressWarnings("unchecked")
    @Test
    public void xorNonConfirming() {
        TypeConfig config = defaultBinder.instance(TestInterface.class).as(TestImplementation1.class).when((BindingCondition<TestInterface>) confirming)
                .xor((BindingCondition<TestInterface>) nonConfirming).build();
        TypeContainer container;
       
        container = config.getTypeContainer(null, TestInterface.class, null, null, null);
        assertNotNull(container);
        assertEquals(TestImplementation1.class, container.getType());
        assertFalse(container.isSingleton());
        assertEquals(InstanceMode.CONSTRUCTOR, container.getInstanceMode());
    }
View Full Code Here

Examples of com.github.jsr330.instance.TypeContainer

   
    @Test
    public void usingDefaultConstructor() {
        TypeConfig config = defaultBinder.instance(TestImplementation1.class).as(TestImplementation1.class)
                .using(defaultConstructor(TestImplementation1.class)).build();
        TypeContainer container;
       
        container = config.getTypeContainer(null, TestImplementation1.class, null, null, null);
        assertNotNull(container);
        assertEquals(TestImplementation1.class, container.getType());
        assertFalse(container.isSingleton());
        assertEquals(InstanceMode.CONSTRUCTOR, container.getInstanceMode());
        assertEquals(defaultConstructor(TestImplementation1.class), container.getConstructor());
        assertNull(container.getFactoryMethod());
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.definitions.TypeContainer

        }
        if (policy.getUAProfAttribute() != null) {
            buffer.append("    uaProfAttribute=" + policy.getUAProfAttribute() + "\n");
        }

        TypeContainer typeContainer = policy.getTypeContainer();
        if (typeContainer != null) {
            dumpTypeContainer(typeContainer, buffer);
        }
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.definitions.TypeContainer

            // that the UpdateClient merge report can access it from there
            // rather than using the old JDOM accessor code as it does now.

            // Set the the type
            // Work out the type of the policy.
            final TypeContainer typeContainer = policy.getTypeContainer();
            String typeName = typeContainer.getName();
            Type type = typeContainer.getType();
            if (typeName != null && type == null) {
                // this is a reference to a declared type.
                TypeDeclaration declaration = definitions.getType(typeName);
                if (declaration == null) {
                    throw new RepositoryException(EXCEPTION_LOCALIZER.format(
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.