final class ProtoStreamReaderImpl extends java.lang.Object implements MessageMarshaller.ProtoStreamReader
| Modifier and Type | Field and Description |
|---|---|
private SerializationContextImpl |
ctx |
private static Log |
log |
private ReadMessageContext |
messageContext |
private static java.util.EnumSet<Type> |
primitiveTypes |
| Constructor and Description |
|---|
ProtoStreamReaderImpl(SerializationContextImpl ctx) |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkFieldRead(FieldDescriptor fd,
boolean expectRepeated) |
private java.lang.Object |
convertWireTypeToJavaType(Type type,
java.lang.Object o) |
SerializationContext |
getSerializationContext() |
(package private) UnknownFieldSet |
getUnknownFieldSet() |
(package private) void |
popContext() |
(package private) ReadMessageContext |
pushContext(FieldDescriptor fd,
MessageMarshallerDelegate<?> marshallerDelegate,
RawProtoStreamReader in) |
<E> E[] |
readArray(java.lang.String fieldName,
java.lang.Class<? extends E> elementClass) |
java.lang.Boolean |
readBoolean(java.lang.String fieldName) |
byte[] |
readBytes(java.lang.String fieldName) |
<E,C extends java.util.Collection<? super E>> |
readCollection(java.lang.String fieldName,
C collection,
java.lang.Class<E> elementClass) |
java.util.Date |
readDate(java.lang.String fieldName) |
java.lang.Double |
readDouble(java.lang.String fieldName) |
java.lang.Float |
readFloat(java.lang.String fieldName) |
java.lang.Integer |
readInt(java.lang.String fieldName)
Can't return an
int here because the field might be declared optional and missing so we might need to
return a null. |
java.lang.Long |
readLong(java.lang.String fieldName) |
private <A> A |
readNestedObject(FieldDescriptor fd,
java.lang.Class<A> clazz,
RawProtoStreamReader in,
int length)
Read an Object or an Enum.
|
<E> E |
readObject(java.lang.String fieldName,
java.lang.Class<E> clazz) |
private java.lang.Object |
readPrimitive(java.lang.String fieldName,
JavaType javaType) |
private void |
readPrimitiveCollection(FieldDescriptor fd,
java.util.Collection<? super java.lang.Object> collection,
java.lang.Class elementClass) |
java.lang.String |
readString(java.lang.String fieldName) |
private static final Log log
private static final java.util.EnumSet<Type> primitiveTypes
private final SerializationContextImpl ctx
private ReadMessageContext messageContext
public ProtoStreamReaderImpl(SerializationContextImpl ctx)
ReadMessageContext pushContext(FieldDescriptor fd, MessageMarshallerDelegate<?> marshallerDelegate, RawProtoStreamReader in)
void popContext()
UnknownFieldSet getUnknownFieldSet()
private java.lang.Object readPrimitive(java.lang.String fieldName,
JavaType javaType)
throws java.io.IOException
java.io.IOExceptionprivate java.lang.Object convertWireTypeToJavaType(Type type, java.lang.Object o)
public SerializationContext getSerializationContext()
getSerializationContext in interface MessageMarshaller.ProtoStreamReaderpublic java.lang.Integer readInt(java.lang.String fieldName)
throws java.io.IOException
MessageMarshaller.ProtoStreamReaderint here because the field might be declared optional and missing so we might need to
return a null.readInt in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic java.lang.Long readLong(java.lang.String fieldName)
throws java.io.IOException
readLong in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic java.util.Date readDate(java.lang.String fieldName)
throws java.io.IOException
readDate in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic java.lang.Float readFloat(java.lang.String fieldName)
throws java.io.IOException
readFloat in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic java.lang.Double readDouble(java.lang.String fieldName)
throws java.io.IOException
readDouble in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic java.lang.Boolean readBoolean(java.lang.String fieldName)
throws java.io.IOException
readBoolean in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic java.lang.String readString(java.lang.String fieldName)
throws java.io.IOException
readString in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic byte[] readBytes(java.lang.String fieldName)
throws java.io.IOException
readBytes in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionpublic <E> E readObject(java.lang.String fieldName,
java.lang.Class<E> clazz)
throws java.io.IOException
readObject in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionprivate <A> A readNestedObject(FieldDescriptor fd, java.lang.Class<A> clazz, RawProtoStreamReader in, int length) throws java.io.IOException
length - the actual length of the nested object or -1 if the length should be read from the streamjava.io.IOExceptionpublic <E,C extends java.util.Collection<? super E>> C readCollection(java.lang.String fieldName,
C collection,
java.lang.Class<E> elementClass)
throws java.io.IOException
readCollection in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionprivate void readPrimitiveCollection(FieldDescriptor fd, java.util.Collection<? super java.lang.Object> collection, java.lang.Class elementClass) throws java.io.IOException
java.io.IOExceptionpublic <E> E[] readArray(java.lang.String fieldName,
java.lang.Class<? extends E> elementClass)
throws java.io.IOException
readArray in interface MessageMarshaller.ProtoStreamReaderjava.io.IOExceptionprivate void checkFieldRead(FieldDescriptor fd, boolean expectRepeated)