1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tools.metalava.model 17 18 /** 19 * The visibility levels for classes and class members. 20 * 21 * <p>The order is significant. It is from least visible to most visible, where visibility is in terms of whether it 22 * is viewable in the final generated API. 23 */ 24 enum class VisibilityLevel( 25 /** 26 * String representation in source code. 27 */ 28 val javaSourceCodeModifier: String, 29 30 /** 31 * String representation in Kotlin source code. 32 */ 33 val kotlinSourceCodeModifier: String, 34 35 /** 36 * String representation in user visible messages. 37 */ 38 val userVisibleDescription: String, 39 /** 40 * Representation in the internal flags. 41 */ 42 val visibilityFlagValue: Int 43 ) { 44 PRIVATE("private", "private", "private", DefaultModifierList.PRIVATE), 45 INTERNAL("internal", "internal", "internal", DefaultModifierList.INTERNAL), 46 PACKAGE_PRIVATE("", "", "package private", DefaultModifierList.PACKAGE_PRIVATE), 47 PROTECTED("protected", "protected", "protected", DefaultModifierList.PROTECTED), 48 PUBLIC("public", "", "public", DefaultModifierList.PUBLIC) 49 } 50