Package org.eclipse.sapphire.modeling.el

Examples of org.eclipse.sapphire.modeling.el.FunctionContext


    @Test

    public void testSeverityFunctionNull()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Severity( null ) }" ).evaluate( context );
       
        try
        {
View Full Code Here


    @Test

    public void testSeverityFunctionWrongType()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Severity( 'abc' ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

    @Test
   
    public void testEndsWithFunction()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Value.EndsWith( 'defg' ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

    @Test
   
    public void testContentFunction()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        FunctionResult fr = ExpressionLanguageParser.parse( "${ IntegerValue.Content }" ).evaluate( context );
       
        try
        {
View Full Code Here

    @Test

    public void testContentFunctionNull()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Content( null ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

    @Test

    public void testContentFunctionWrongType()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Content( 'abc' ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

    @Test
   
    public void testAbsolutePathFunction() throws Exception
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        final FunctionResult fr = ExpressionLanguageParser.parse( "${ Path.Absolute }" ).evaluate( context );
       
        try
        {
View Full Code Here

    @Test
   
    public void testFragmentFunction()
    {
        final TestElement element = TestElement.TYPE.instantiate();
        final FunctionContext context = new ModelElementFunctionContext( element );
       
        FunctionResult fr = ExpressionLanguageParser.parse( "${ Value.Fragment( 0, 3 ) }" ).evaluate( context );
       
        try
        {
View Full Code Here

            Sapphire.service( LoggingService.class ).log( e );
            ignoreCaseDifferencesFunction = Literal.FALSE;
        }
       
        final Element element = context( Element.class );
        final FunctionContext context = ( element == null ? new FunctionContext() : new ModelElementFunctionContext( element ) );
       
        this.ignoreCaseDifferencesFunctionResult = ignoreCaseDifferencesFunction.evaluate( context );
       
        this.ignoreCaseDifferencesFunctionResult.attach
        (
View Full Code Here

        }
       
        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 );
        }
       
        if( versionedFunction == null )
        {
            versionedFunction = Literal.NULL;
            this.versionedFunctionResult = versionedFunction.evaluate( new FunctionContext() );
        }
        else
        {
            versionedFunction = FailSafeFunction.create( versionedFunction, Literal.create( String.class ), null );
           
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.modeling.el.FunctionContext

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.