/// <summary> /// Gets the attribute of the given type. /// </summary> /// <typeparam name="T">The type of the attribute.</typeparam> /// <param name="jc">The java class.</param> /// <returns>The attribute of the given type.</returns> public static T GetAttribute <T>(this JavaClass jc) where T : IJavaAttribute { Guard.NotNull(ref jc, nameof(jc)); return(jc.GetAttributes <T>().FirstOrDefault()); }
private static TypeDefinition ConvertClass(JavaClass jc) { string className = $"{jc.GetPackageName()}{jc.GetName()}"; string dotnetNamespace = IdentifierHelper.GetDotNetNamespace(className); string dotnetClass = IdentifierHelper.GetDotNetClassName(className); TypeDefinition result = new TypeDefinition(dotnetNamespace, dotnetClass, jc.GetAttributes()); return(result); }