示例#1
0
    internal static object AnnotationsToMap(ClassLoaderWrapper loader, object[] objAnn)
    {
#if FIRST_PASS
        return(null);
#else
        java.util.LinkedHashMap map = new java.util.LinkedHashMap();
        if (objAnn != null)
        {
            foreach (object obj in objAnn)
            {
                java.lang.annotation.Annotation a = obj as java.lang.annotation.Annotation;
                if (a != null)
                {
                    map.put(a.annotationType(), FreezeOrWrapAttribute(a));
                }
                else if (obj is IKVM.Attributes.DynamicAnnotationAttribute)
                {
                    a = (java.lang.annotation.Annotation)JVM.NewAnnotation(loader.GetJavaClassLoader(), ((IKVM.Attributes.DynamicAnnotationAttribute)obj).Definition);
                    if (a != null)
                    {
                        map.put(a.annotationType(), a);
                    }
                }
            }
        }
        return(map);
#endif
    }
示例#2
0
    public static void expandIkvmClasses(object _zipFile, object _entries)
    {
#if !FIRST_PASS
        java.util.zip.ZipFile   zipFile = (java.util.zip.ZipFile)_zipFile;
        java.util.LinkedHashMap entries = (java.util.LinkedHashMap)_entries;

        try
        {
            string path = zipFile.getName();
            java.util.zip.ZipEntry entry = (java.util.zip.ZipEntry)entries.get(JVM.JarClassList);
            if (entry != null && VirtualFileSystem.IsVirtualFS(path))
            {
                using (VirtualFileSystem.ZipEntryStream stream = new VirtualFileSystem.ZipEntryStream(zipFile, entry))
                {
                    entries.remove(entry.name);
                    BinaryReader br    = new BinaryReader(stream);
                    int          count = br.ReadInt32();
                    for (int i = 0; i < count; i++)
                    {
                        java.util.zip.ClassStubZipEntry classEntry = new java.util.zip.ClassStubZipEntry(path, br.ReadString());
                        classEntry.setMethod(java.util.zip.ClassStubZipEntry.STORED);
                        classEntry.setTime(entry.getTime());
                        entries.put(classEntry.name, classEntry);
                    }
                }
            }
        }
        catch (java.io.IOException)
        {
        }
        catch (IOException)
        {
        }
#endif
    }
示例#3
0
 internal static object AnnotationsToMap(ClassLoaderWrapper loader, object[] objAnn)
 {
     #if FIRST_PASS
     return null;
     #else
     java.util.LinkedHashMap map = new java.util.LinkedHashMap();
     if (objAnn != null)
     {
         foreach (object obj in objAnn)
         {
             java.lang.annotation.Annotation a = obj as java.lang.annotation.Annotation;
             if (a != null)
             {
                 map.put(a.annotationType(), FreezeOrWrapAttribute(a));
             }
             else if (obj is IKVM.Attributes.DynamicAnnotationAttribute)
             {
                 a = (java.lang.annotation.Annotation)JVM.NewAnnotation(loader.GetJavaClassLoader(), ((IKVM.Attributes.DynamicAnnotationAttribute)obj).Definition);
                 if (a != null)
                 {
                     map.put(a.annotationType(), a);
                 }
             }
         }
     }
     return map;
     #endif
 }