static Object readObjectFrom(Input input, Schema<?> schema, Object owner,
            IdStrategy strategy, int number) throws IOException
    {
        final Schema<Object> derivedSchema = strategy.resolvePojoFrom(input,
                number).getSchema();

        final Object pojo = derivedSchema.newMessage();

        if (input instanceof GraphInput)
        {
            // update the actual reference.
            ((GraphInput) input).updateLast(pojo, owner);
        }

        if (__cause != null)
        {
            final Object cause;
            try
            {
                cause = __cause.get(pojo);
            }
            catch (IllegalAccessException e)
            {
                throw new RuntimeException(e);
            }
            catch (IllegalArgumentException e)
            {
                throw new RuntimeException(e);
            }

            if (cause == null)
            {
                // was not written because it was cyclic
                // so we set it here manually for correctness
                try
                {
                    __cause.set(pojo, cause);
                }
                catch (IllegalAccessException e)
                {
                    throw new RuntimeException(e);
                }
                catch (IllegalArgumentException e)
                {
                    throw new RuntimeException(e);
                }
            }
        }

        derivedSchema.mergeFrom(input, pojo);
        return pojo;
    }
Used when the type is assignable from {@link java.lang.Throwable}.

@author David Yu
@created May 2, 2012
protostuff-runtime/src/main/java/io/protostuff/runtime/PolymorphicThrowableSchema.java