Class DescriptorMessageInfoFactory

    • Constructor Detail

      • DescriptorMessageInfoFactory

        private DescriptorMessageInfoFactory()
    • Method Detail

      • isSupported

        public boolean isSupported​(java.lang.Class<?> messageType)
        Description copied from interface: MessageInfoFactory
        Whether the message class is supported by this factory.
        Specified by:
        isSupported in interface MessageInfoFactory
      • getDefaultInstance

        private static Message getDefaultInstance​(java.lang.Class<?> messageType)
      • descriptorForType

        private static Descriptors.Descriptor descriptorForType​(java.lang.Class<?> messageType)
      • needsIsInitializedCheck

        private static boolean needsIsInitializedCheck​(Descriptors.Descriptor descriptor)
      • bitField

        private static java.lang.reflect.Field bitField​(java.lang.Class<?> messageType,
                                                        int index)
      • cachedSizeField

        private static java.lang.reflect.Field cachedSizeField​(java.lang.Class<?> messageType,
                                                               Descriptors.FieldDescriptor fd)
      • field

        private static java.lang.reflect.Field field​(java.lang.Class<?> messageType,
                                                     java.lang.String fieldName)
      • snakeCaseToCamelCase

        private static java.lang.String snakeCaseToCamelCase​(java.lang.String snakeCase)
        This method must match exactly with the corresponding function in protocol compiler. See: https://github.com/google/protobuf/blob/v3.0.0/src/google/protobuf/compiler/java/java_helpers.cc#L153
      • getOneofStoredTypeForMessage

        private static java.lang.Class<?> getOneofStoredTypeForMessage​(java.lang.Class<?> messageType,
                                                                       Descriptors.FieldDescriptor fd)
        Inspects the message to identify the stored type for a message field that is part of a oneof.
      • getTypeForRepeatedMessageField

        private static java.lang.Class<?> getTypeForRepeatedMessageField​(java.lang.Class<?> messageType,
                                                                         Descriptors.FieldDescriptor fd)
        Inspects the message to identify the message type of a repeated message field.
      • getterForField

        private static java.lang.String getterForField​(java.lang.String snakeCase)
        Constructs the name of the get method for the given field in the proto.