Package org.eclipse.sapphire.modeling.annotations

Examples of org.eclipse.sapphire.modeling.annotations.Type


        this.propertyName = propertyName;
        this.baseProperty = baseProperty;
       
        try
        {
            final Type typeAnnotation = getAnnotation( Type.class );
           
            if( typeAnnotation == null )
            {
                if( this instanceof ValueProperty )
                {
                    this.typeClass = String.class;
                }
                else
                {
                    final String message
                        = "Property \"" + propertyName + "\" of " + this.modelElementType.getModelElementClass().getClass()
                          + " is missing the required Type annotation.";
                   
                    throw new IllegalStateException( message );
                }
            }
            else
            {
                this.typeClass = typeAnnotation.base();
            }
        }
        catch( RuntimeException e )
        {
            Sapphire.service( LoggingService.class ).log( e );
View Full Code Here


    protected void initPossibleTypesService()
    {
        final PropertyDef property = context( PropertyDef.class );
        final List<Class<?>> possible = new ArrayList<Class<?>>();
       
        final Type typeAnnotation = property.getAnnotation( Type.class );
       
        if( property instanceof ElementProperty || property instanceof ListProperty )
        {
            if( typeAnnotation != null )
            {
                if( typeAnnotation.possible().length == 0 )
                {
                    possible.add( typeAnnotation.base() );
                }
                else
                {
                    for( Class<?> cl : typeAnnotation.possible() )
                    {
                        possible.add( cl );
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.annotations.Type

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.