Android 支持库ExiFinInterface检查属性是否存在或获取所有属性

Android 支持库ExiFinInterface检查属性是否存在或获取所有属性,android,android-support-library,exif,Android,Android Support Library,Exif,支持库版本25.1.0添加了一个新功能ExifInterface,该功能支持Android 7.1中添加到ExifInterface的功能 但是,如何在不提供默认值的情况下检查特定文件是否实际具有特定的int或double属性?或者有获取属性列表的选项吗?没有现成的hasAttribute方法,这将非常方便,但是您可以使用StringgetAttribute方法,当文件不包含请求的属性时,该方法返回null 类似这样的内容: public static boolean hasAttribute(

支持库版本25.1.0添加了一个新功能
ExifInterface
,该功能支持Android 7.1中添加到
ExifInterface
的功能


但是,如何在不提供默认值的情况下检查特定文件是否实际具有特定的
int
double
属性?或者有获取属性列表的选项吗?

没有现成的
hasAttribute
方法,这将非常方便,但是您可以使用
String
getAttribute
方法,当文件不包含请求的属性时,该方法返回
null

类似这样的内容:

public static boolean hasAttribute(ExifInterface exif, String attribute){
    return exif.getAttribute(attribute) != null;
}
不幸的是,没有从给定文件中获取所有属性的方法