public V unmarshall()

in lightning-core/src/main/java/org/apache/directmemory/lightning/internal/marshaller/ListMarshaller.java [116:161]


    public <V> V unmarshall( PropertyDescriptor propertyDescriptor, Source source,
                             SerializationContext serializationContext )
        throws IOException
    {
        if ( isNull( source ) )
        {
            return null;
        }

        int size = source.readInt();
        List list = new ArrayList( size );
        if ( size > 0 )
        {
            for ( int i = 0; i < size; i++ )
            {
                if ( isNull( source ) )
                {
                    list.add( null );
                }
                else
                {
                    long classId = source.readLong();
                    ClassDefinition classDefinition =
                        serializationContext.getClassDefinitionContainer().getClassDefinitionById( classId );

                    Marshaller marshaller;
                    if ( listType != null )
                    {
                        ensureMarshallerInitialized( serializationContext );
                        marshaller = listTypeMarshaller;
                    }
                    else
                    {
                        marshaller = serializationContext.findMarshaller( classDefinition.getType() );
                    }

                    PropertyDescriptor pd =
                        new CheatPropertyDescriptor( propertyDescriptor.getPropertyName() + "List",
                                                     classDefinition.getType(), marshaller );
                    list.add( marshaller.unmarshall( pd, source, serializationContext ) );
                }
            }
        }

        return (V) list;
    }