public class UTType extends NSObject implements NSCopying, NSSecureCoding
Types may represent files on disk, abstract data types with no on-disk representation, or even entirely unrelated hierarchical classification systems such as hardware.
Older API that does not use \c UTType typically uses an untyped \c NSString or \c CFStringRef to refer to a type by its identifier. To get the identifier of a type for use with these APIs, use the \c identifier property of this class.
\sa https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
UTType(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
static UTType |
alloc() |
static UTType |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
boolean |
conformsToType(UTType type)
\brief Tests for a conformance relationship between the receiver and another
type.
|
java.lang.Object |
copyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
encodeWithCoder(NSCoder coder) |
static UTType |
exportedTypeWithIdentifier(java.lang.String identifier)
\brief Gets an active \c UTType corresponding to a type that is declared as
"exported" by the current process.
|
static UTType |
exportedTypeWithIdentifierConformingToType(java.lang.String identifier,
UTType parentType)
\brief Gets an active \c UTType corresponding to a type that is declared as
"exported" by the current process.
|
static long |
hash_static() |
java.lang.String |
identifier()
\brief The receiver's identifier.
|
static UTType |
importedTypeWithIdentifier(java.lang.String identifier)
\brief Gets an active \c UTType corresponding to a type that is declared as
"imported" by the current process.
|
static UTType |
importedTypeWithIdentifierConformingToType(java.lang.String identifier,
UTType parentType)
\brief Gets an active \c UTType corresponding to a type that is declared as
"imported" by the current process.
|
UTType |
init() |
UTType |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isDeclared()
\brief Whether or not the receiver is a type known to the system.
|
boolean |
isDynamic()
\brief Whether or not the receiver is a dynamically generated type.
|
boolean |
isPublicType()
\brief Whether or not the type is in the public domain.
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
boolean |
isSubtypeOfType(UTType type)
\brief Tests if the receiver is a subtype of another type.
|
boolean |
isSupertypeOfType(UTType type)
\brief Tests if the receiver is a supertype of another type.
|
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
java.lang.String |
localizedDescription()
\brief The localized description of the type.
|
static UTType |
new_objc() |
java.lang.String |
preferredFilenameExtension()
\brief If available, the preferred (first available) tag of class
\c UTTagClassFilenameExtension.
|
java.lang.String |
preferredMIMEType()
\brief If available, the preferred (first available) tag of class
\c UTTagClassMIMEType.
|
NSURL |
referenceURL()
\brief The reference URL of the type.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
NSSet<? extends UTType> |
supertypes()
\brief The set of types to which the receiving type conforms, directly or
indirectly.
|
static boolean |
supportsSecureCoding() |
NSDictionary<java.lang.String,? extends NSArray<java.lang.String>> |
tags()
\brief The tag specification dictionary of the type.
|
static NSArray<? extends UTType> |
typesWithTagTagClassConformingToType(java.lang.String tag,
java.lang.String tagClass,
UTType supertype)
\brief Create an array of types given a type tag.
|
static UTType |
typeWithFilenameExtension(java.lang.String filenameExtension)
\brief Create a type given a filename extension that conforms to
\c UTTypeData.
|
static UTType |
typeWithFilenameExtensionConformingToType(java.lang.String filenameExtension,
UTType supertype)
\brief Create a type given a filename extension.
|
static UTType |
typeWithIdentifier(java.lang.String identifier)
\brief Create a type given a type identifier.
|
static UTType |
typeWithMIMEType(java.lang.String mimeType)
\brief Create a type given a MIME type that conforms to \c UTTypeData.
|
static UTType |
typeWithMIMETypeConformingToType(java.lang.String mimeType,
UTType supertype)
\brief Create a type given a MIME type.
|
static UTType |
typeWithTagTagClassConformingToType(java.lang.String tag,
java.lang.String tagClass,
UTType supertype)
\brief Create a type given a type tag.
|
NSNumber |
version()
\brief The type's version.
|
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, version_static, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static UTType alloc()
public static UTType allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public boolean conformsToType(UTType type)
\param type The type against which conformance should be tested.
\result If the two types are equal, returns \c YES. If the receiver conforms, directly or indirectly, to \a type, returns \c YES. Otherwise, returns \c NO.
\sa -isSupertypeOfType: \sa -isSubtypeOfType:
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
copyWithZone in interface NSCopyingpublic static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public void encodeWithCoder(NSCoder coder)
encodeWithCoder in interface NSCodingpublic static UTType exportedTypeWithIdentifier(java.lang.String identifier)
\param identifier The type identifier for which a type is desired.
\result A type.
Use this method to get types that are exported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined.
Conformance to either \c UTTypeData or \c UTTypePackage is assumed.
You would generally use this method with \c dispatch_once():
\code UTType *GetMyFileFormat(void) { static UTType *result = nil;
static dispatch_once_t once; dispatch_once(&once, ^ { result = [UTType exportedTypeWithIdentifier:@"com.example.myfileformat"]; });
return result; } \endcode
public static UTType exportedTypeWithIdentifierConformingToType(java.lang.String identifier, UTType parentType)
\param identifier The type identifier for which a type is desired. \param parentType A parent type that the resulting type is expected to conform to.
\result A type.
Use this method to get types that are exported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined.
You would generally use this method with \c dispatch_once():
\code UTType *GetMyFileFormat(void) { static UTType *result = nil;
static dispatch_once_t once; dispatch_once(&once, ^ { result = [UTType exportedTypeWithIdentifier:@"com.example.myfileformat" conformingToType:UTTypeData]; });
return result; } \endcode
public static long hash_static()
public java.lang.String identifier()
A type is \em identified \em by its Uniform Type Identifier (UTI), a reverse-DNS string such as \c "public.jpeg" or \c "com.adobe.pdf". The type itself \em has a UTI, but is not itself the UTI. This terminology is not consistently used across Apple's documentation.
public static UTType importedTypeWithIdentifier(java.lang.String identifier)
\param identifier The type identifier for which a type is desired.
\result A type whose identifier may or may not be equal to \a identifier, but which is functionally equivalent.
Use this method to get types that are imported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined.
Conformance to either \c UTTypeData or \c UTTypePackage is assumed.
You would generally use this method in the body of a funcion or method and would \em not use \c dispatch_once() as the type can change over time:
\code UTType *GetCompetitorFileFormat(void) { return [UTType importedTypeWithIdentifier:@"com.example.competitorfileformat"]; } \endcode
In the general case, this method returns a type with the same identifier, but if that type has a preferred filename extension and \em another type is the preferred type for that extension, then that \em other type is substituted.
public static UTType importedTypeWithIdentifierConformingToType(java.lang.String identifier, UTType parentType)
\param identifier The type identifier for which a type is desired. \param parentType A parent type that the resulting type is expected to conform to.
\result A type whose identifier may or may not be equal to \a identifier, but which is functionally equivalent.
Use this method to get types that are imported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined.
You would generally use this method in the body of a funcion or method and would \em not use \c dispatch_once() as the type can change over time:
\code UTType *GetCompetitorFileFormat(void) { return [UTType importedTypeWithIdentifier:@"com.example.competitorfileformat" conformingToType:UTTypeData]; } \endcode
In the general case, this method returns a type with the same identifier, but if that type has a preferred filename extension and \em another type is the preferred type for that extension, then that \em other type is substituted.
public UTType initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodingpublic static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public boolean isDeclared()
A type cannot be both declared \em and dynamic.
public boolean isDynamic()
Dynamic types are recognized by the system, but may not be directly declared or claimed by an application. They are used when a file is encountered whose metadata has no corresponding type known to the system.
A type cannot be both declared \em and dynamic.
public boolean isPublicType()
Types in the public domain have identifiers starting with \c "public." and are generally defined by a standards body or by convention. They are never dynamic.
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public boolean isSubtypeOfType(UTType type)
\param type The type against which conformance should be tested.
\result If the receiver conforms, directly or indirectly, to \a type and is not equal to it, returns \c YES. Otherwise, returns \c NO.
\sa -conformsToType: \sa -isSupertypeOfType:
public boolean isSupertypeOfType(UTType type)
\param type The type against which conformance should be tested.
\result If \a type conforms, directly or indirectly, to the receiver and is not equal to it, returns \c YES. Otherwise, returns \c NO.
\sa -conformsToType: \sa -isSubtypeOfType:
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public java.lang.String localizedDescription()
If the type does not provide a description, the system may search its supertypes for one. Dynamic types never have localized descriptions even if their supertypes do.
public static UTType new_objc()
public java.lang.String preferredFilenameExtension()
Many uses of types require the generation of a filename (e.g. when saving a file to disk.) If not \c nil, the value of this property is the best available filename extension for the given type. The value of this property is equivalent to, but more efficient than:
\code type.tags[UTTagClassFilenameExtension].firstObject \endcode
public java.lang.String preferredMIMEType()
If not \c nil, the value of this property is the best available MIME type for the given type, according to its declaration. The value of this property is equivalent to, but more efficient than:
\code type.tags[UTTagClassMIMEType].firstObject \endcode
public NSURL referenceURL()
A reference URL is a human-readable document describing a type. Most types do not specify reference URLs.
\warning This URL is not validated in any way by the system, nor is its scheme or structure guaranteed in any way.
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public NSSet<? extends UTType> supertypes()
If you are just interested in checking if one type conforms to another, it is more efficient to use \c -conformsToType: than this property.
public static boolean supportsSecureCoding()
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCodingpublic NSDictionary<java.lang.String,? extends NSArray<java.lang.String>> tags()
The system does not store tag information for non-standard tag classes. It normalizes string values into arrays containing those strings. For instance, a value of:
\code { "public.mime-type": "x/y", "nonstandard-tag-class": "abc", } \endcode
Is normalized to:
\code { "public.mime-type": [ "x/y" ] } \endcode
If you are simply looking for the preferred filename extension or MIME type of a type, it is more efficient for you to use the \c preferredFilenameExtension and \c preferredMIMEType properties respectively.
public static UTType typeWithFilenameExtension(java.lang.String filenameExtension)
\param filenameExtension The filename extension for which a type is desired.
\result A type. If no types are known to the system with the specified filename extension and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil.
This method is equivalent to:
\code [UTType typeWithTag:filenameExtension tagClass:UTTagClassFilenameExtension conformingToType:UTTypeData] \endcode
To get the type of a file on disk, use the \c NSURLContentTypeKey property. You should not attempt to derive the type of a file system object based solely on its path extension.
public static UTType typeWithFilenameExtensionConformingToType(java.lang.String filenameExtension, UTType supertype)
\param filenameExtension The filename extension for which a type is desired. \param supertype Another type that the resulting type must conform to. Typically, you would pass \c UTTypeData or \c UTTypePackage.
\result A type. If no types are known to the system with the specified filename extension and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil.
This method is equivalent to:
\code [UTType typeWithTag:filenameExtension tagClass:UTTagClassFilenameExtension conformingToType:supertype] \endcode
To get the type of a file on disk, use the \c NSURLContentTypeKey property. You should not attempt to derive the type of a file system object based solely on its path extension.
public static UTType typeWithIdentifier(java.lang.String identifier)
\param identifier The type identifier.
\result A type, or \c nil if the type identifier is not known to the system.
public static UTType typeWithMIMEType(java.lang.String mimeType)
\param mimeType The MIME type for which a type is desired.
\result A type. If no types are known to the system with the specified MIME type and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil.
This method is equivalent to:
\code [UTType typeWithTag:mimeType tagClass:UTTagClassMIMEType conformingToType:UTTypeData] \endcode
public static UTType typeWithMIMETypeConformingToType(java.lang.String mimeType, UTType supertype)
\param mimeType The MIME type for which a type is desired. \param supertype Another type that the resulting type must conform to. Typically, you would pass \c UTTypeData.
\result A type. If no types are known to the system with the specified MIME type and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil.
This method is equivalent to:
\code [UTType typeWithTag:mimeType tagClass:UTTagClassMIMEType conformingToType:supertype] \endcode
public static UTType typeWithTagTagClassConformingToType(java.lang.String tag, java.lang.String tagClass, UTType supertype)
\param tag The tag, such as the path extension, for which a type is desired. \param tagClass The class of the tag, such as \c UTTagClassFilenameExtension. \param supertype Another type that the resulting type must conform to. If \c nil, no conformance is required.
\result A type. If no types are known to the system with the specified tag but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil.
public static NSArray<? extends UTType> typesWithTagTagClassConformingToType(java.lang.String tag, java.lang.String tagClass, UTType supertype)
\param tag The tag, such as the path extension, for which a set of types is desired. \param tagClass The class of the tag, such as \c UTTagClassFilenameExtension. \param supertype Another type that the resulting types must conform to. If \c nil, no conformance is required.
\result An array of types, or the empty array if no such types were available. If no types are known to the system with the specified tag but the inputs were otherwise valid, a dynamic type may be provided.
public NSNumber version()
Most types do not specify a version.