com.google.protobuf.gwt.shared
Class UninitializedMessageException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.protobuf.gwt.shared.UninitializedMessageException
- All Implemented Interfaces:
- Serializable
public class UninitializedMessageException
- extends RuntimeException
Thrown when attempting to build a protocol message that is missing required
fields. This is a RuntimeException
because it normally represents a
programming error: it happens when some code which constructs a message
fails to set all the fields. parseFrom()
methods do not throw
this; they throw an InvalidProtocolBufferException
if required fields
are missing, because it is not a programming error to receive an incomplete
message. In other words, UninitializedMessageException
should never
be thrown by correct code, but InvalidProtocolBufferException
might
be.
- Author:
- vkulikov@alum.mit.edu Vitaliy Kulikov Based on the original non-GWT
Java implementation by kenton@google.com Kenton Varda
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
UninitializedMessageException
public UninitializedMessageException(Message message)
asInvalidProtocolBufferException
public InvalidProtocolBufferException asInvalidProtocolBufferException()
- Converts this exception to an
InvalidProtocolBufferException
. When
a parsed message is missing required fields, this should be thrown instead
of UninitializedMessageException
.
Copyright © 2014 InMobi. All rights reserved.