Extract non-descriptor specific abstract ancestor for BinaryClassAnnotationAndConstantLoader

This commit is contained in:
Pavel V. Talanov
2014-11-27 17:52:06 +03:00
parent 39e1dfbcc0
commit f0a9c4f683
10 changed files with 459 additions and 403 deletions
@@ -21,12 +21,14 @@ import org.jetbrains.jet.lang.descriptors.*
import org.jetbrains.jet.descriptors.serialization.*
import org.jetbrains.jet.descriptors.serialization.descriptors.AnnotationAndConstantLoader
import org.jetbrains.jet.lang.resolve.name.ClassId
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor
public class DeserializationComponents(
public val storageManager: StorageManager,
public val moduleDescriptor: ModuleDescriptor,
public val classDataFinder: ClassDataFinder,
public val annotationAndConstantLoader: AnnotationAndConstantLoader,
public val annotationAndConstantLoader: AnnotationAndConstantLoader<AnnotationDescriptor, CompileTimeConstant<*>>,
public val packageFragmentProvider: PackageFragmentProvider,
public val flexibleTypeCapabilitiesDeserializer: FlexibleTypeCapabilitiesDeserializer
) {
@@ -25,8 +25,9 @@ import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
import java.util.List;
public interface AnnotationAndConstantLoader {
AnnotationAndConstantLoader UNSUPPORTED = new AnnotationAndConstantLoader() {
public interface AnnotationAndConstantLoader<A, C> {
AnnotationAndConstantLoader<AnnotationDescriptor, CompileTimeConstant<?>> UNSUPPORTED =
new AnnotationAndConstantLoader<AnnotationDescriptor, CompileTimeConstant<?>>() {
@NotNull
@Override
public List<AnnotationDescriptor> loadClassAnnotations(
@@ -77,13 +78,13 @@ public interface AnnotationAndConstantLoader {
};
@NotNull
List<AnnotationDescriptor> loadClassAnnotations(
List<A> loadClassAnnotations(
@NotNull ProtoBuf.Class classProto,
@NotNull NameResolver nameResolver
);
@NotNull
List<AnnotationDescriptor> loadCallableAnnotations(
List<A> loadCallableAnnotations(
@NotNull ProtoContainer container,
@NotNull ProtoBuf.Callable proto,
@NotNull NameResolver nameResolver,
@@ -91,7 +92,7 @@ public interface AnnotationAndConstantLoader {
);
@NotNull
List<AnnotationDescriptor> loadValueParameterAnnotations(
List<A> loadValueParameterAnnotations(
@NotNull ProtoContainer container,
@NotNull ProtoBuf.Callable callable,
@NotNull NameResolver nameResolver,
@@ -100,7 +101,7 @@ public interface AnnotationAndConstantLoader {
);
@Nullable
CompileTimeConstant<?> loadPropertyConstant(
C loadPropertyConstant(
@NotNull ProtoContainer container,
@NotNull ProtoBuf.Callable proto,
@NotNull NameResolver nameResolver,