Package com.dyuproject.protostuff.runtime.IdStrategy

Examples of com.dyuproject.protostuff.runtime.IdStrategy.Wrapper


                }
               
                if(next != 1)
                    throw new ProtostuffException("Corrupt input");
               
                final Wrapper wrapper = new Wrapper();
                Object element = input.mergeObject(wrapper, strategy.OBJECT_SCHEMA);
                if(!graph || !((GraphInput)input).isCurrentMessageReference())
                    element = wrapper.value;
               
                try
                {
                    fSingletonSet_element.set(collection, element);
                }
                catch (IllegalArgumentException e)
                {
                    throw new RuntimeException(e);
                }
                catch (IllegalAccessException e)
                {
                    throw new RuntimeException(e);
                }
               
                ret = collection;
                break;
            }
           
            case ID_SINGLETON_LIST:
            {
                if(0 != input.readUInt32())
                    throw new ProtostuffException("Corrupt input.");
               
                final Object collection = iSingletonList.newInstance();
                if(graph)
                {
                    // update the actual reference.
                    ((GraphInput)input).updateLast(collection, owner);
                }
               
                final int next = input.readFieldNumber(schema);
                if(next == 0)
                {
                    // null element
                    return collection;
                }
               
                if(next != 1)
                    throw new ProtostuffException("Corrupt input.");
               
                final Wrapper wrapper = new Wrapper();
                Object element = input.mergeObject(wrapper, strategy.OBJECT_SCHEMA);
                if(!graph || !((GraphInput)input).isCurrentMessageReference())
                    element = wrapper.value;
               
                try
                {
                    fSingletonList_element.set(collection, element);
                }
                catch (IllegalArgumentException e)
                {
                    throw new RuntimeException(e);
                }
                catch (IllegalAccessException e)
                {
                    throw new RuntimeException(e);
                }
               
                ret = collection;
                break;
            }
           
            case ID_SET_FROM_MAP:
            {
                final Object collection = iSetFromMap.newInstance();
                if(graph)
                {
                    // update the actual reference.
                    ((GraphInput)input).updateLast(collection, owner);
                }
               
                final Wrapper wrapper = new Wrapper();
                Object m = input.mergeObject(wrapper, strategy.POLYMORPHIC_MAP_SCHEMA);
                if(!graph || !((GraphInput)input).isCurrentMessageReference())
                    m = wrapper.value;
               
                try
                {
                    fSetFromMap_m.set(collection, m);
                    fSetFromMap_s.set(collection, ((Map<?,?>)m).keySet());
                }
                catch (IllegalArgumentException e)
                {
                    throw new RuntimeException(e);
                }
                catch (IllegalAccessException e)
                {
                    throw new RuntimeException(e);
                }
               
                ret = collection;
                break;
            }
               
            case ID_COPIES_LIST:
            {
                if(0 != input.readUInt32())
                    throw new ProtostuffException("Corrupt input.");
               
                final Object collection = iCopiesList.newInstance();
                if(graph)
                {
                    // update the actual reference.
                    ((GraphInput)input).updateLast(collection, owner);
                }
               
                if(1 != input.readFieldNumber(schema))
                    throw new ProtostuffException("Corrupt input.");
               
                final int n = input.readUInt32(),
                        next = input.readFieldNumber(schema);
               
                if(next == 0)
                {
                    // null element
                    try
                    {
                        fCopiesList_n.setInt(collection, n);
                    }
                    catch (IllegalArgumentException e)
                    {
                        throw new RuntimeException(e);
                    }
                    catch (IllegalAccessException e)
                    {
                        throw new RuntimeException(e);
                    }
                   
                    return collection;
                }
               
                if(next != 2)
                    throw new ProtostuffException("Corrupt input.");
               
                final Wrapper wrapper = new Wrapper();
                Object element = input.mergeObject(wrapper, strategy.OBJECT_SCHEMA);
                if(!graph || !((GraphInput)input).isCurrentMessageReference())
                    element = wrapper.value;
               
                try
View Full Code Here


        {
            // update the actual reference.
            ((GraphInput)input).updateLast(collection, owner);
        }
       
        final Wrapper wrapper = new Wrapper();
        Object c = input.mergeObject(wrapper, strategy.POLYMORPHIC_COLLECTION_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            c = wrapper.value;
        try
        {
View Full Code Here

        {
            // update the actual reference.
            ((GraphInput)input).updateLast(collection, owner);
        }
       
        final Wrapper wrapper = new Wrapper();
        Object c = input.mergeObject(wrapper, strategy.POLYMORPHIC_COLLECTION_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            c = wrapper.value;
        try
        {
View Full Code Here

        {
            // update the actual reference.
            ((GraphInput)input).updateLast(collection, owner);
        }
       
        final Wrapper wrapper = new Wrapper();
        Object c = input.mergeObject(wrapper, strategy.POLYMORPHIC_COLLECTION_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            c = wrapper.value;
       
        if(1 != input.readFieldNumber(schema))
View Full Code Here

                break;
            }
            case 3:
            {
                // key is null
                final Wrapper wrapper = new Wrapper();
                Object v = input.mergeObject(wrapper, strategy.OBJECT_SCHEMA);
                if(!graph || !((GraphInput)input).isCurrentMessageReference())
                    v = wrapper.value;
               
                try
                {
                    fSingletonMap_v.set(map, v);
                }
                catch (IllegalArgumentException e)
                {
                    throw new RuntimeException(e);
                }
                catch (IllegalAccessException e)
                {
                    throw new RuntimeException(e);
                }
               
                if(0 != input.readFieldNumber(schema))
                    throw new ProtostuffException("Corrupt input.");
               
                return map;
            }
            default:
                throw new ProtostuffException("Corrupt input.");
        }
       
        final Wrapper wrapper = new Wrapper();
        Object k = input.mergeObject(wrapper, strategy.OBJECT_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            k = wrapper.value;
       
        switch(input.readFieldNumber(schema))
View Full Code Here

        {
            // update the actual reference.
            ((GraphInput)input).updateLast(map, owner);
        }
       
        final Wrapper wrapper = new Wrapper();
        Object m = input.mergeObject(wrapper, strategy.POLYMORPHIC_MAP_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            m = wrapper.value;
        try
        {
View Full Code Here

        {
            // update the actual reference.
            ((GraphInput)input).updateLast(map, owner);
        }
       
        final Wrapper wrapper = new Wrapper();
        Object m = input.mergeObject(wrapper, strategy.POLYMORPHIC_MAP_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            m = wrapper.value;
        try
        {
View Full Code Here

        {
            // update the actual reference.
            ((GraphInput)input).updateLast(map, owner);
        }
       
        final Wrapper wrapper = new Wrapper();
        Object m = input.mergeObject(wrapper, strategy.POLYMORPHIC_MAP_SCHEMA);
        if(!graph || !((GraphInput)input).isCurrentMessageReference())
            m = wrapper.value;
       
        if(1 != input.readFieldNumber(schema))
View Full Code Here

TOP

Related Classes of com.dyuproject.protostuff.runtime.IdStrategy.Wrapper

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.