/* * Copyright (C) 2019 The Dagger Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Serialized forms of types used in the Dagger processor. The wire format of // these types is not guaranteed to remain compatible over time; serialization // is only expected to function correctly within an individual version of the // Dagger processor. syntax = "proto3"; package dagger.internal.codegen.serialization; option java_package = "dagger.internal.codegen.serialization"; option java_multiple_files = true; // TODO(ronshapiro): consider exposing some of these in // dagger.model.serialization // Serialized form of `dagger.internal.codegen.BindingRequest` message BindingRequestProto { KeyProto key = 1; RequestKindWrapper.RequestKind request_kind = 2; FrameworkTypeWrapper.FrameworkType framework_type = 3; } message RequestKindWrapper { // Serialized form of `dagger.model.RequestKind` enum RequestKind { UNKNOWN = 0; INSTANCE = 1; PROVIDER = 2; LAZY = 3; PROVIDER_OF_LAZY = 4; MEMBERS_INJECTION = 5; PRODUCER = 6; PRODUCED = 7; FUTURE = 8; } } message FrameworkTypeWrapper { // Serialized form of `dagger.internal.codegen.FrameworkType` enum FrameworkType { UNKNOWN = 0; PROVIDER = 1; PRODUCER_NODE = 2; } } // Serialized form of `dagger.model.Key` message KeyProto { TypeProto type = 1; AnnotationProto qualifier = 2; MultibindingContributionIdentifier multibinding_contribution_identifier = 3; // Serialized form of `dagger.model.Key.MultibindingContributionIdentifier` message MultibindingContributionIdentifier { string module = 1; string binding_element = 2; } } // Serialized form of `javax.lang.model.type.TypeMirror` message TypeProto { PrimitiveKind primitive_kind = 1; // The qualified name of the type. Absent if this is an inner type. string qualified_name = 2; // The enclosing type if this is an inner type, otherwise absent. TypeProto enclosing_type = 3; // Simple name of the type if this is an inner type, otherwise absent. string simple_name = 4; repeated TypeProto type_arguments = 5; message Wildcard { TypeProto extends_bound = 1; TypeProto super_bound = 2; } Wildcard wildcard = 6; int32 array_dimensions = 7; // Kinds of primitive types enum PrimitiveKind { UNKNOWN = 0; BOOLEAN = 1; BYTE = 2; SHORT = 3; CHAR = 4; INT = 5; FLOAT = 6; LONG = 7; DOUBLE = 8; } } // Serialized form of `javax.lang.model.element.AnnotationMirror` message AnnotationProto { TypeProto annotation_type = 1; map values = 2; } // Serialized form of `javax.lang.model.element.AnnotationValue` message AnnotationValueProto { Kind kind = 1; bool boolean_value = 2; int32 int_value = 3; int64 long_value = 4; float float_value = 5; double double_value = 6; string string_value = 7; TypeProto class_literal = 8; TypeProto enum_type = 9; string enum_name = 10; AnnotationProto nested_annotation = 11; repeated AnnotationValueProto array_values = 12; // The type of annotation value enum Kind { UNKNOWN = 0; BOOLEAN = 1; BYTE = 2; SHORT = 3; CHAR = 4; INT = 5; FLOAT = 6; LONG = 7; DOUBLE = 8; STRING = 9; CLASS_LITERAL = 10; ENUM = 11; ANNOTATION = 12; ARRAY = 13; } } // Serialized form of `dagger.internal.codegen.ComponentRequirement` message ComponentRequirementProto { oneof requirement { TypeProto dependency = 1; TypeProto module = 2; BoundInstanceRequirement bound_instance = 3; } message BoundInstanceRequirement { KeyProto key = 1; bool nullable = 2; string variable_name = 3; } }