Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.ElementData


    @Test
   
    public void CopyElementData() throws Exception
    {
        final ElementData a = new ElementData( CopyTestElementRoot.TYPE );
        ElementData ac1;
        ElementData ac2;
        List<ElementData> list;
       
        a.write( "ValueProperty1", "abc" );
        a.write( "ValueProperty2", 5 );
        a.write( "ValueProperty3", null );
       
        ac1 = new ElementData( CopyTestElementChild.TYPE );
        a.write( "ImpliedElementProperty1", ac1 );
        ac1.write( "ValueProperty1", "implied-1" );
       
        ac2 = new ElementData( CopyTestElementChildEx.TYPE );
        a.write( "ImpliedElementProperty2", ac2 );
        ac2.write( "ValueProperty1", "implied-2-a" );
        ac2.write( "ValueProperty2", "implied-2-b" );
       
        ac1 = new ElementData( CopyTestElementChild.TYPE );
        a.write( "ElementProperty1", ac1 );
        ac1.write( "ValueProperty1", "element-1" );
       
        ac2 = new ElementData( CopyTestElementChildEx.TYPE );
        a.write( "ElementProperty2", ac2 );
        ac2.write( "ValueProperty1", "element-2-a" );
        ac2.write( "ValueProperty2", "element-2-b" );
       
        list = new ArrayList<ElementData>();
        a.write( "ListProperty1", list );
       
        ac1 = new ElementData( CopyTestElementChild.TYPE );
        list.add( ac1 );
        ac1.write( "ValueProperty1", "list-1-a" );
       
        ac1 = new ElementData( CopyTestElementChild.TYPE );
        list.add( ac1 );
        ac1.write( "ValueProperty1", "list-1-b" );
       
        ac1 = new ElementData( CopyTestElementChild.TYPE );
        list.add( ac1 );
        ac1.write( "ValueProperty1", "list-1-c" );
       
        list = new ArrayList<ElementData>();
        a.write( "ListProperty2", list );
       
        ac1 = new ElementData( CopyTestElementChild.TYPE );
        list.add( ac1 );
        ac1.write( "ValueProperty1", "list-2-a" );

        ac2 = new ElementData( CopyTestElementChildEx.TYPE );
        list.add( ac2 );
        ac2.write( "ValueProperty1", "list-2-b-a" );
        ac2.write( "ValueProperty2", "list-2-b-b" );
       
        ac2 = new ElementData( CopyTestElementChildEx.TYPE );
        list.add( ac2 );
        ac2.write( "ValueProperty1", "list-2-c-a" );
        ac2.write( "ValueProperty2", "list-2-c-b" );
       
        final Object t = new Object();
        a.write( "TransientProperty", t );
       
        final CopyTestElementRoot b = CopyTestElementRoot.TYPE.instantiate();
View Full Code Here


           
            for( int i = 0; i < size; i++ )
            {
                final String qualifiedTypeName = in.readUTF();
                final ElementType type = ElementType.read( this.classLoader, qualifiedTypeName );
                final ElementData element = new ElementData( type );
                nativeToJava( in, element );
                elementsListFactory.add( element );
            }
           
            return elementsListFactory.result();
View Full Code Here

                }
                else if( property instanceof ElementProperty )
                {
                    final String qualifiedTypeName = in.readUTF();
                    final ElementType type = ElementType.read( this.classLoader, qualifiedTypeName );
                    final ElementData child = new ElementData( type );
                    element.write( propertyName, child );
                    nativeToJava( in, child );
                }
                else if( property instanceof ListProperty )
                {
                    final ListFactory<ElementData> listFactory = ListFactory.start();
                    final int size = in.readInt();
                   
                    for( int i = 0; i < size; i++ )
                    {
                        final String qualifiedTypeName = in.readUTF();
                        final ElementType type = ElementType.read( this.classLoader, qualifiedTypeName );
                        final ElementData child = new ElementData( type );
                        listFactory.add( child );
                        nativeToJava( in, child );
                    }
                   
                    element.write( propertyName, listFactory.result() );
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ElementData

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.