001 /* 002 * Copyright 2010-2015 JetBrains s.r.o. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.jetbrains.kotlin.serialization; 018 019 import org.jetbrains.annotations.NotNull; 020 import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor; 021 import org.jetbrains.kotlin.descriptors.ClassDescriptor; 022 import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor; 023 import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor; 024 import org.jetbrains.kotlin.types.JetType; 025 026 import java.util.Collection; 027 028 public abstract class SerializerExtension { 029 public void serializeClass( 030 @NotNull ClassDescriptor descriptor, 031 @NotNull ProtoBuf.Class.Builder proto, 032 @NotNull StringTable stringTable 033 ) { 034 } 035 036 public void serializePackage( 037 @NotNull Collection<PackageFragmentDescriptor> packageFragments, 038 @NotNull ProtoBuf.Package.Builder proto, 039 @NotNull StringTable stringTable 040 ) { 041 } 042 043 public void serializeCallable( 044 @NotNull CallableMemberDescriptor callable, 045 @NotNull ProtoBuf.Callable.Builder proto, 046 @NotNull StringTable stringTable 047 ) { 048 } 049 050 public void serializeValueParameter( 051 @NotNull ValueParameterDescriptor descriptor, 052 @NotNull ProtoBuf.Callable.ValueParameter.Builder proto, 053 @NotNull StringTable stringTable 054 ) { 055 } 056 057 public void serializeType( 058 @NotNull JetType type, 059 @NotNull ProtoBuf.Type.Builder proto, 060 @NotNull StringTable stringTable 061 ) { 062 } 063 064 @NotNull 065 public String getLocalClassName(@NotNull ClassDescriptor descriptor) { 066 throw new UnsupportedOperationException("Local classes are unsupported: " + descriptor); 067 } 068 }