Exemple #1
0
        private static FieldDefinition ConvertField(AssemblyDefinition assembly, JavaClass jc, JavaField jf)
        {
            string          name       = jf.GetName(jc);
            FieldAttributes attributes = jf.GetAttributes();
            FieldDefinition result     = new FieldDefinition(name, attributes, assembly.MainModule.GetDescriptorType(jf.GetDescriptor(jc)));

            return(result);
        }
Exemple #2
0
 /// <summary>
 /// Gets the attribute of the given type.
 /// </summary>
 /// <typeparam name="T">The type of the attribute.</typeparam>
 /// <param name="jf">The java field.</param>
 /// <returns>The attribute of the given type.</returns>
 public static T GetAttribute <T>(this JavaField jf)
     where T : IJavaAttribute
 {
     Guard.NotNull(ref jf, nameof(jf));
     return(jf.GetAttributes <T>().FirstOrDefault());
 }