/// <summary> /// Create a type builder for the given type with JavaImport attribute. /// </summary> internal static IClassBuilder CreateJavaImportBuilder(ReachableContext context, AssemblyCompiler compiler, TypeDefinition typeDef) { var javaImportAttr = typeDef.GetJavaImportAttribute(true); var className = (string)javaImportAttr.ConstructorArguments[0].Value; ClassFile classFile; if (!compiler.ClassLoader.TryLoadClass(className, out classFile)) throw new ClassNotFoundException(className); context.RecordReachableType(classFile); return new SkipClassBuilder(); }