Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.VersionCompatibilityTarget


    protected void initContextVersionService()
    {
        final Element element = context( Element.class );
        final PropertyDef property = context( PropertyDef.class );
       
        final VersionCompatibilityTarget versionCompatibilityTargetAnnotation;
       
        if( property != null )
        {
            versionCompatibilityTargetAnnotation = property.getAnnotation( VersionCompatibilityTarget.class );
        }
        else
        {
            versionCompatibilityTargetAnnotation = element.type().getAnnotation( VersionCompatibilityTarget.class );
        }
       
        Function versionFunction = null;
       
        try
        {
            versionFunction = ExpressionLanguageParser.parse( versionCompatibilityTargetAnnotation.version() );
        }
        catch( Exception e )
        {
            Sapphire.service( LoggingService.class ).log( e );
        }
       
        if( versionFunction == null )
        {
            versionFunction = Literal.NULL;
            this.versionedFunctionResult = versionFunction.evaluate( new FunctionContext() );
        }
        else
        {
            versionFunction = FailSafeFunction.create( versionFunction, Literal.create( Version.class ), null );
           
            this.versionFunctionResult = versionFunction.evaluate( new ModelElementFunctionContext( element ) );
           
            this.versionFunctionResult.attach
            (
                new Listener()
                {
                    @Override
                    public void handle( final Event event )
                    {
                        refresh();
                    }
                }
            );
        }

        Function versionedFunction = null;
       
        try
        {
            versionedFunction = ExpressionLanguageParser.parse( versionCompatibilityTargetAnnotation.versioned() );
        }
        catch( Exception e )
        {
            Sapphire.service( LoggingService.class ).log( e );
        }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.VersionCompatibilityTarget

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.