Package org.qi4j.api.composite

Examples of org.qi4j.api.composite.ModelDescriptor


            else
            {
                throw new InvalidInjectionException( "Unknown injection annotation @" + injectionAnnotationType.getSimpleName() );
            }
        }
        ModelDescriptor composite = resolution.model();
        Class<?> compositeType = composite.type();
        if( factory1 != null && ValueComposite.class.isAssignableFrom( compositeType ) )
        {
            throw new InvalidValueCompositeException( "@" + injectionAnnotationType.getSimpleName() + " is not allowed in ValueComposites: " + compositeType );
        }
View Full Code Here


            else
            {
                throw new InvalidInjectionException( "Unknown injection annotation @" + injectionAnnotationType.getSimpleName() );
            }
        }
        ModelDescriptor composite = resolution.model();
        Class<?> compositeType = first( composite.types() );
        if( factory1 != null && ValueComposite.class.isAssignableFrom( compositeType ) )
        {
            throw new InvalidValueCompositeException( "@" + injectionAnnotationType.getSimpleName() + " is not allowed in ValueComposites: " + compositeType );
        }
View Full Code Here

    {
        Object configDescriptor = null;

        for( Object obj : iter )
        {
            ModelDescriptor descriptor;

            if( obj instanceof ServiceDetailDescriptor )
            {
                descriptor = ( (ServiceDetailDescriptor) obj ).descriptor();
            }
            else if( obj instanceof EntityDetailDescriptor )
            {
                descriptor = ( (EntityDetailDescriptor) obj ).descriptor();
            }
            else if( obj instanceof ValueDetailDescriptor )
            {
                descriptor = ( (ValueDetailDescriptor) obj ).descriptor();
            }
            else if( obj instanceof ObjectDetailDescriptor )
            {
                descriptor = ( (ObjectDetailDescriptor) obj ).descriptor();
            }
            else
            {
                descriptor = ( (CompositeDetailDescriptor) obj ).descriptor();
            }

            if( configType.equals( first( descriptor.types() ) ) )
            {
                configDescriptor = obj;
                break;
            }
        }
View Full Code Here

        if( configDescriptor == null )
        {
            return;
        }

        ModelDescriptor spiDescriptor = null;
        String typeString = null;
        if( configDescriptor instanceof ServiceDetailDescriptor )
        {
            spiDescriptor = ( (ServiceDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Service";
        }
        else if( configDescriptor instanceof EntityDetailDescriptor )
        {
            spiDescriptor = ( (EntityDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Entity";
        }
        else if( configDescriptor instanceof ValueDetailDescriptor )
        {
            spiDescriptor = ( (ValueDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Value";
        }
        else if( configDescriptor instanceof ObjectDetailDescriptor )
        {
            spiDescriptor = ( (ObjectDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Object";
        }
        else if( configDescriptor instanceof CompositeDetailDescriptor )
        {
            spiDescriptor = ( (ObjectDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Transient";
        }

        Class<?> type = first( spiDescriptor.types() );
        String simpleName = type.getSimpleName();
        nameLabel.setText( "<html><a href='" + simpleName + "'>" + simpleName + "</a></html>" );
        classLabel.setText( type.getName() );
        typeLabel.setText( typeString );
        linkButton.setEnabled( true );
View Full Code Here

        if( configDescriptor == null )
        {
            return;
        }

        ModelDescriptor spiDescriptor;
        String typeString;
        if( configDescriptor instanceof ServiceDetailDescriptor )
        {
            spiDescriptor = ( (ServiceDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Service";
        }
        else if( configDescriptor instanceof EntityDetailDescriptor )
        {
            spiDescriptor = ( (EntityDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Entity";
        }
        else if( configDescriptor instanceof ValueDetailDescriptor )
        {
            spiDescriptor = ( (ValueDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Value";
        }
        else if( configDescriptor instanceof ObjectDetailDescriptor )
        {
            spiDescriptor = ( (ObjectDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Object";
        }
        else if( configDescriptor instanceof CompositeDetailDescriptor )
        {
            spiDescriptor = ( (CompositeDetailDescriptor) configDescriptor ).descriptor();
            typeString = "Transient";
        }
        else
        {
            throw new PrintingException( "Unknown configuration descriptor: " + configDescriptor.getClass()
                .getName(), null );
        }

        setFont( normalFont, normalFontSize );
        writeString( "- name: " + spiDescriptor.toString() );
        writeString( "- class: " + spiDescriptor.toString() );
        writeString( "- type: " + typeString );
    }
View Full Code Here

TOP

Related Classes of org.qi4j.api.composite.ModelDescriptor

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.