dc5bc1488c
Write KotlinInfo annotation to the facade package class
214 lines
4.4 KiB
Protocol Buffer
214 lines
4.4 KiB
Protocol Buffer
/*
|
|
* Copyright 2010-2013 JetBrains s.r.o.
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
package org.jetbrains.jet.descriptors.serialization;
|
|
|
|
option java_outer_classname = "ProtoBuf";
|
|
option optimize_for = LITE_RUNTIME; // Smaller runtime
|
|
option java_generic_services = false; // Less code
|
|
|
|
message SimpleNameTable {
|
|
repeated string name = 1;
|
|
}
|
|
|
|
message QualifiedNameTable {
|
|
|
|
message QualifiedName {
|
|
optional int32 parent_qualified_name = 1 [default = -1];
|
|
required int32 short_name = 2;
|
|
optional Kind kind = 3 [default = PACKAGE];
|
|
|
|
enum Kind {
|
|
CLASS = 0;
|
|
PACKAGE = 1;
|
|
}
|
|
}
|
|
|
|
repeated QualifiedName qualified_name = 1;
|
|
}
|
|
|
|
message Type {
|
|
message Constructor {
|
|
enum Kind {
|
|
CLASS = 0;
|
|
TYPE_PARAMETER = 1;
|
|
}
|
|
|
|
optional Kind kind = 1 [default = CLASS];
|
|
|
|
required int32 id = 2; // CLASS - fqName id, TYPE_PARAMETER - type parameter id
|
|
}
|
|
|
|
required Constructor constructor = 1;
|
|
|
|
message Argument {
|
|
enum Projection {
|
|
IN = 0;
|
|
OUT = 1;
|
|
INV = 2;
|
|
}
|
|
|
|
optional Projection projection = 1 [default = INV];
|
|
required Type type = 2;
|
|
}
|
|
|
|
repeated Argument argument = 2;
|
|
|
|
optional bool nullable = 3 [default = false];
|
|
}
|
|
|
|
message TypeParameter {
|
|
required int32 id = 1;
|
|
required int32 name = 2;
|
|
|
|
optional bool reified = 3 [default = false];
|
|
|
|
enum Variance {
|
|
IN = 0;
|
|
OUT = 1;
|
|
INV = 2;
|
|
}
|
|
optional Variance variance = 4 [default = INV];
|
|
|
|
repeated Type upper_bound = 5;
|
|
}
|
|
|
|
message Class {
|
|
enum Kind {
|
|
// 3 bits
|
|
CLASS = 0;
|
|
TRAIT = 1;
|
|
ENUM_CLASS = 2;
|
|
ENUM_ENTRY = 3;
|
|
ANNOTATION_CLASS = 4;
|
|
OBJECT = 5;
|
|
CLASS_OBJECT = 6;
|
|
}
|
|
|
|
/*
|
|
Visibility
|
|
Modality
|
|
has_annotation
|
|
ClassKind
|
|
is_inner
|
|
*/
|
|
optional int32 flags = 1 [default = 0 /*internal final class, no annotations*/];
|
|
optional string extra_visibility = 2; // for things like java-specific visibilities
|
|
|
|
required int32 name = 4;
|
|
|
|
repeated TypeParameter type_parameter = 5;
|
|
repeated Type supertype = 6;
|
|
|
|
// we store only names, because the actual information must reside in the corresponding .class files,
|
|
// to be obtainable through reflection at runtime
|
|
repeated int32 nested_class_name = 7;
|
|
repeated int32 nested_object_name = 8;
|
|
|
|
optional bool class_object_present = 9 [default = false];
|
|
|
|
optional Callable primary_constructor = 10;
|
|
// todo: other constructors?
|
|
|
|
repeated Callable member = 11;
|
|
|
|
repeated int32 enum_entry = 12;
|
|
}
|
|
|
|
message Package {
|
|
repeated Callable member = 1;
|
|
|
|
repeated int32 class_name = 2;
|
|
}
|
|
|
|
message Callable {
|
|
enum MemberKind {
|
|
// 2 bits
|
|
DECLARATION = 0;
|
|
FAKE_OVERRIDE = 1;
|
|
DELEGATION = 2;
|
|
SYNTHESIZED = 3;
|
|
}
|
|
|
|
enum CallableKind {
|
|
// 2 bits
|
|
FUN = 0;
|
|
VAL = 1;
|
|
VAR = 2;
|
|
CONSTRUCTOR = 3;
|
|
}
|
|
|
|
/*
|
|
Visibility
|
|
Modality
|
|
has_annotations
|
|
CallableKind
|
|
MemberKind
|
|
inline
|
|
hasGetter
|
|
hasSetter
|
|
*/
|
|
optional int32 flags = 1;
|
|
optional string extra_visibility = 2; // for things like java-specific visibilities
|
|
|
|
/*
|
|
isNotDefault
|
|
Visibility
|
|
Modality
|
|
has_annotations
|
|
*/
|
|
optional int32 getter_flags = 9 /* absent => same as property */;
|
|
optional int32 setter_flags = 10 /* absent => same as property */;
|
|
optional int32 setter_parameter_name = 11;
|
|
|
|
repeated TypeParameter type_parameter = 4;
|
|
|
|
optional Type receiver_type = 5;
|
|
|
|
required int32 name = 6;
|
|
|
|
message ValueParameter {
|
|
/*
|
|
declaresDefault
|
|
has_annotations
|
|
*/
|
|
optional int32 flags = 1;
|
|
required int32 name = 2;
|
|
required Type type = 3;
|
|
optional Type vararg_element_type = 4;
|
|
|
|
}
|
|
|
|
repeated ValueParameter value_parameter = 7;
|
|
|
|
required Type return_type = 8;
|
|
}
|
|
|
|
enum Modality {
|
|
// 2 bits
|
|
FINAL = 0x00;
|
|
OPEN = 0x01;
|
|
ABSTRACT = 0x02;
|
|
}
|
|
|
|
enum Visibility {
|
|
// 3 bits
|
|
INTERNAL = 0x00;
|
|
PRIVATE = 0x01;
|
|
PROTECTED = 0x02;
|
|
PUBLIC = 0x03;
|
|
EXTRA = 0x04; // there's an extra field for the actual visibility
|
|
} |