Class NSCoder

    • Constructor Detail

      • NSCoder

        protected NSCoder​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static NSCoder alloc()
      • allocWithZone

        public static NSCoder allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • new_objc

        public static NSCoder new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • allowedClasses

        @Nullable
        public @Nullable NSSet<? extends org.moe.natj.objc.Class> allowedClasses()
        Get the current set of allowed classes. API-Since: 6.0
      • allowsKeyedCoding

        public boolean allowsKeyedCoding()
      • containsValueForKey

        public boolean containsValueForKey​(@NotNull
                                           @NotNull java.lang.String key)
      • decodeArrayOfObjCTypeCountAt

        public void decodeArrayOfObjCTypeCountAt​(@NotNull
                                                 @NotNull java.lang.String itemType,
                                                 long count,
                                                 @NotNull
                                                 @NotNull org.moe.natj.general.ptr.VoidPtr array)
      • decodeBoolForKey

        public boolean decodeBoolForKey​(@NotNull
                                        @NotNull java.lang.String key)
      • decodeBytesForKeyReturnedLength

        @Nullable
        public @Nullable org.moe.natj.general.ptr.ConstBytePtr decodeBytesForKeyReturnedLength​(@NotNull
                                                                                               @NotNull java.lang.String key,
                                                                                               @Nullable
                                                                                               @Nullable org.moe.natj.general.ptr.NUIntPtr lengthp)
        returned bytes immutable!
      • decodeBytesWithReturnedLength

        @Nullable
        public @Nullable org.moe.natj.general.ptr.VoidPtr decodeBytesWithReturnedLength​(@NotNull
                                                                                        @NotNull org.moe.natj.general.ptr.NUIntPtr lengthp)
      • decodeCGAffineTransformForKey

        public CGAffineTransform decodeCGAffineTransformForKey​(@NotNull
                                                               @NotNull java.lang.String key)
      • decodeCGPointForKey

        public CGPoint decodeCGPointForKey​(@NotNull
                                           @NotNull java.lang.String key)
      • decodeCGRectForKey

        public CGRect decodeCGRectForKey​(@NotNull
                                         @NotNull java.lang.String key)
      • decodeCGSizeForKey

        public CGSize decodeCGSizeForKey​(@NotNull
                                         @NotNull java.lang.String key)
      • decodeCGVectorForKey

        public CGVector decodeCGVectorForKey​(@NotNull
                                             @NotNull java.lang.String key)
      • decodeCMTimeForKey

        public CMTime decodeCMTimeForKey​(@NotNull
                                         @NotNull java.lang.String key)
        API-Since: 4.0
      • decodeCMTimeMappingForKey

        public CMTimeMapping decodeCMTimeMappingForKey​(@NotNull
                                                       @NotNull java.lang.String key)
        API-Since: 4.0
      • decodeCMTimeRangeForKey

        public CMTimeRange decodeCMTimeRangeForKey​(@NotNull
                                                   @NotNull java.lang.String key)
        API-Since: 4.0
      • decodeDataObject

        @Nullable
        public @Nullable NSData decodeDataObject()
      • decodeDoubleForKey

        public double decodeDoubleForKey​(@NotNull
                                         @NotNull java.lang.String key)
      • decodeFloatForKey

        public float decodeFloatForKey​(@NotNull
                                       @NotNull java.lang.String key)
      • decodeInt32ForKey

        public int decodeInt32ForKey​(@NotNull
                                     @NotNull java.lang.String key)
      • decodeInt64ForKey

        public long decodeInt64ForKey​(@NotNull
                                      @NotNull java.lang.String key)
      • decodeIntForKey

        public int decodeIntForKey​(@NotNull
                                   @NotNull java.lang.String key)
      • decodeIntegerForKey

        public long decodeIntegerForKey​(@NotNull
                                        @NotNull java.lang.String key)
        API-Since: 2.0
      • decodeObject

        @Nullable
        public @Nullable java.lang.Object decodeObject()
      • decodeObjectForKey

        @Nullable
        public @Nullable java.lang.Object decodeObjectForKey​(@NotNull
                                                             @NotNull java.lang.String key)
      • decodeObjectOfClassForKey

        @Nullable
        public @Nullable java.lang.Object decodeObjectOfClassForKey​(@NotNull
                                                                    @NotNull org.moe.natj.objc.Class aClass,
                                                                    @NotNull
                                                                    @NotNull java.lang.String key)
        Specify what the expected class of the allocated object is. If the coder responds YES to -requiresSecureCoding, then an exception will be thrown if the class to be decoded does not implement NSSecureCoding or is not isKindOfClass: of the argument. If the coder responds NO to -requiresSecureCoding, then the class argument is ignored and no check of the class of the decoded object is performed, exactly as if decodeObjectForKey: had been called. API-Since: 6.0
      • decodeObjectOfClassesForKey

        @Nullable
        public @Nullable java.lang.Object decodeObjectOfClassesForKey​(@Nullable
                                                                      @Nullable NSSet<? extends org.moe.natj.objc.Class> classes,
                                                                      @NotNull
                                                                      @NotNull java.lang.String key)
        The class of the object may be any class in the provided NSSet, or a subclass of any class in the set. Otherwise, the behavior is the same as -decodeObjectOfClass:forKey:. API-Since: 6.0
      • decodePropertyListForKey

        @Nullable
        public @Nullable java.lang.Object decodePropertyListForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
        Calls -decodeObjectOfClasses:forKey: with a set allowing only property list types. API-Since: 6.0
      • decodeTopLevelObjectAndReturnError

        @Nullable
        public @Nullable java.lang.Object decodeTopLevelObjectAndReturnError​(@Nullable
                                                                             @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 9.0
      • decodeTopLevelObjectForKeyError

        @Nullable
        public @Nullable java.lang.Object decodeTopLevelObjectForKeyError​(@NotNull
                                                                          @NotNull java.lang.String key,
                                                                          @Nullable
                                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 9.0
      • decodeTopLevelObjectOfClassForKeyError

        @Nullable
        public @Nullable java.lang.Object decodeTopLevelObjectOfClassForKeyError​(@NotNull
                                                                                 @NotNull org.moe.natj.objc.Class aClass,
                                                                                 @NotNull
                                                                                 @NotNull java.lang.String key,
                                                                                 @Nullable
                                                                                 @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 9.0
      • decodeTopLevelObjectOfClassesForKeyError

        @Nullable
        public @Nullable java.lang.Object decodeTopLevelObjectOfClassesForKeyError​(@Nullable
                                                                                   @Nullable NSSet<? extends org.moe.natj.objc.Class> classes,
                                                                                   @NotNull
                                                                                   @NotNull java.lang.String key,
                                                                                   @Nullable
                                                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 9.0
      • decodeUIEdgeInsetsForKey

        public UIEdgeInsets decodeUIEdgeInsetsForKey​(@NotNull
                                                     @NotNull java.lang.String key)
      • decodeUIOffsetForKey

        public UIOffset decodeUIOffsetForKey​(@NotNull
                                             @NotNull java.lang.String key)
        API-Since: 5.0
      • decodeValueOfObjCTypeAt

        @Deprecated
        public void decodeValueOfObjCTypeAt​(@NotNull
                                            @NotNull java.lang.String type,
                                            @NotNull
                                            @NotNull org.moe.natj.general.ptr.VoidPtr data)
        Deprecated.
        This method is unsafe because it could potentially cause buffer overruns. You should use -decodeValueOfObjCType:at:size: instead. API-Since: 2.0 Deprecated-Since: 100000.0
      • decodeValuesOfObjCTypes

        public void decodeValuesOfObjCTypes​(@NotNull
                                            @NotNull java.lang.String types,
                                            java.lang.Object... varargs)
      • decodingFailurePolicy

        public long decodingFailurePolicy()
        Defines the behavior this NSCoder should take on decode failure (i.e. corrupt archive, invalid data, etc.). The default result of this property is NSDecodingFailurePolicyRaiseException, subclasses can change this to an alternative policy. API-Since: 9.0
      • encodeArrayOfObjCTypeCountAt

        public void encodeArrayOfObjCTypeCountAt​(@NotNull
                                                 @NotNull java.lang.String type,
                                                 long count,
                                                 @NotNull
                                                 @NotNull org.moe.natj.general.ptr.ConstVoidPtr array)
      • encodeBoolForKey

        public void encodeBoolForKey​(boolean value,
                                     @NotNull
                                     @NotNull java.lang.String key)
      • encodeBycopyObject

        public void encodeBycopyObject​(@Nullable
                                       @Nullable java.lang.Object anObject)
      • encodeByrefObject

        public void encodeByrefObject​(@Nullable
                                      @Nullable java.lang.Object anObject)
      • encodeBytesLength

        public void encodeBytesLength​(@Nullable
                                      @Nullable org.moe.natj.general.ptr.ConstVoidPtr byteaddr,
                                      long length)
      • encodeBytesLengthForKey

        public void encodeBytesLengthForKey​(@Nullable
                                            @Nullable org.moe.natj.general.ptr.ConstBytePtr bytes,
                                            long length,
                                            @NotNull
                                            @NotNull java.lang.String key)
      • encodeCGAffineTransformForKey

        public void encodeCGAffineTransformForKey​(CGAffineTransform transform,
                                                  @NotNull
                                                  @NotNull java.lang.String key)
      • encodeCGPointForKey

        public void encodeCGPointForKey​(CGPoint point,
                                        @NotNull
                                        @NotNull java.lang.String key)
      • encodeCGRectForKey

        public void encodeCGRectForKey​(CGRect rect,
                                       @NotNull
                                       @NotNull java.lang.String key)
      • encodeCGSizeForKey

        public void encodeCGSizeForKey​(CGSize size,
                                       @NotNull
                                       @NotNull java.lang.String key)
      • encodeCGVectorForKey

        public void encodeCGVectorForKey​(CGVector vector,
                                         @NotNull
                                         @NotNull java.lang.String key)
      • encodeCMTimeForKey

        public void encodeCMTimeForKey​(CMTime time,
                                       @NotNull
                                       @NotNull java.lang.String key)
        API-Since: 4.0
      • encodeCMTimeMappingForKey

        public void encodeCMTimeMappingForKey​(CMTimeMapping timeMapping,
                                              @NotNull
                                              @NotNull java.lang.String key)
        API-Since: 4.0
      • encodeCMTimeRangeForKey

        public void encodeCMTimeRangeForKey​(CMTimeRange timeRange,
                                            @NotNull
                                            @NotNull java.lang.String key)
        API-Since: 4.0
      • encodeConditionalObject

        public void encodeConditionalObject​(@Nullable
                                            @Nullable java.lang.Object object)
      • encodeConditionalObjectForKey

        public void encodeConditionalObjectForKey​(@Nullable
                                                  @Nullable java.lang.Object object,
                                                  @NotNull
                                                  @NotNull java.lang.String key)
      • encodeDataObject

        public void encodeDataObject​(@NotNull
                                     @NotNull NSData data)
      • encodeDoubleForKey

        public void encodeDoubleForKey​(double value,
                                       @NotNull
                                       @NotNull java.lang.String key)
      • encodeFloatForKey

        public void encodeFloatForKey​(float value,
                                      @NotNull
                                      @NotNull java.lang.String key)
      • encodeInt32ForKey

        public void encodeInt32ForKey​(int value,
                                      @NotNull
                                      @NotNull java.lang.String key)
      • encodeInt64ForKey

        public void encodeInt64ForKey​(long value,
                                      @NotNull
                                      @NotNull java.lang.String key)
      • encodeIntForKey

        public void encodeIntForKey​(int value,
                                    @NotNull
                                    @NotNull java.lang.String key)
      • encodeIntegerForKey

        public void encodeIntegerForKey​(long value,
                                        @NotNull
                                        @NotNull java.lang.String key)
        API-Since: 2.0
      • encodeObject

        public void encodeObject​(@Nullable
                                 @Nullable java.lang.Object object)
      • encodeObjectForKey

        public void encodeObjectForKey​(@Nullable
                                       @Nullable java.lang.Object object,
                                       @NotNull
                                       @NotNull java.lang.String key)
      • encodeRootObject

        public void encodeRootObject​(@NotNull
                                     @NotNull java.lang.Object rootObject)
      • encodeUIEdgeInsetsForKey

        public void encodeUIEdgeInsetsForKey​(UIEdgeInsets insets,
                                             @NotNull
                                             @NotNull java.lang.String key)
      • encodeUIOffsetForKey

        public void encodeUIOffsetForKey​(UIOffset offset,
                                         @NotNull
                                         @NotNull java.lang.String key)
        API-Since: 5.0
      • encodeValueOfObjCTypeAt

        public void encodeValueOfObjCTypeAt​(@NotNull
                                            @NotNull java.lang.String type,
                                            @NotNull
                                            @NotNull org.moe.natj.general.ptr.ConstVoidPtr addr)
      • encodeValuesOfObjCTypes

        public void encodeValuesOfObjCTypes​(@NotNull
                                            @NotNull java.lang.String types,
                                            java.lang.Object... varargs)
      • error

        @Nullable
        public @Nullable NSError error()
        The current error (if there is one) for the current TopLevel decode. The meaning of this property changes based on the result of the decodingFailurePolicy property: For NSDecodingFailurePolicyRaiseException, this property will always be nil. For NSDecodingFailurePolicySetErrorAndReturn, this property can be non-nil, and if so, indicates that there was a failure while decoding the archive (specifically its the very first error encountered). While .error is non-nil, all attempts to decode data from this coder will return a nil/zero-equivalent value. This error is consumed by a TopLevel decode API (which resets this coder back to a being able to potentially decode data). API-Since: 9.0
      • failWithError

        public void failWithError​(@NotNull
                                  @NotNull NSError error)
        Signals to this coder that the decode has failed. [@parameter] non-nil error that describes the reason why the decode failed Sets an error on this NSCoder once per TopLevel decode; calling it repeatedly will have no effect until the call stack unwinds to one of the TopLevel decode entry-points. This method is only meaningful to call for decodes. Typically, you would want to call this method in your -initWithCoder: implementation when you detect situations like: - lack of secure coding - corruption of your data - domain validation failures After calling -failWithError: within your -initWithCoder: implementation, you should clean up and return nil as early as possible. Once an error has been signaled to a decoder, it remains set until it has handed off to the first TopLevel decode invocation above it. For example, consider the following call graph: A -decodeTopLevelObjectForKey:error: B -initWithCoder: C -decodeObjectForKey: D -initWithCoder: E -decodeObjectForKey: F -failWithError: In this case the error provided in stack-frame F will be returned via the outError in stack-frame A. Furthermore the result object from decodeTopLevelObjectForKey:error: will be nil, regardless of the result of stack-frame B. NSCoder implementations support two mechanisms for the stack-unwinding from F to A: - forced (NSException based) - particpatory (error based) The kind of unwinding you get is determined by the decodingFailurePolicy property of this NSCoder (which defaults to NSDecodingFailurePolicyRaiseException to match historical behavior). API-Since: 9.0
      • requiresSecureCoding

        public boolean requiresSecureCoding()
        Returns YES if this coder requires secure coding. Secure coders check a list of allowed classes before decoding objects, and all objects must implement NSSecureCoding. API-Since: 6.0
      • systemVersion

        public int systemVersion()
      • versionForClassName

        public long versionForClassName​(@NotNull
                                        @NotNull java.lang.String className)
      • decodeDirectionalEdgeInsetsForKey

        public NSDirectionalEdgeInsets decodeDirectionalEdgeInsetsForKey​(@NotNull
                                                                         @NotNull java.lang.String key)
        API-Since: 11.0
      • decodeValueOfObjCTypeAtSize

        public void decodeValueOfObjCTypeAtSize​(@NotNull
                                                @NotNull java.lang.String type,
                                                @NotNull
                                                @NotNull org.moe.natj.general.ptr.VoidPtr data,
                                                long size)
        API-Since: 11.0
      • encodeDirectionalEdgeInsetsForKey

        public void encodeDirectionalEdgeInsetsForKey​(NSDirectionalEdgeInsets insets,
                                                      @NotNull
                                                      @NotNull java.lang.String key)
        API-Since: 11.0
      • decodeArrayOfObjectsOfClassForKey

        @Nullable
        public @Nullable NSArray<?> decodeArrayOfObjectsOfClassForKey​(@NotNull
                                                                      @NotNull org.moe.natj.objc.Class cls,
                                                                      @NotNull
                                                                      @NotNull java.lang.String key)
        Decodes the \c NSArray object for the given \c key, which should be an \c NSArray, containing the given non-collection class (no nested arrays or arrays of dictionaries, etc) from the coder. Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn. Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder. API-Since: 14.0
      • decodeArrayOfObjectsOfClassesForKey

        @Nullable
        public @Nullable NSArray<?> decodeArrayOfObjectsOfClassesForKey​(@NotNull
                                                                        @NotNull NSSet<? extends org.moe.natj.objc.Class> classes,
                                                                        @NotNull
                                                                        @NotNull java.lang.String key)
        Decodes the \c NSArray object for the given \c key, which should be an \c NSArray, containing the given non-collection classes (no nested arrays or arrays of dictionaries, etc) from the coder. Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn. Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder. API-Since: 14.0
      • decodeDictionaryWithKeysOfClassObjectsOfClassForKey

        @Nullable
        public @Nullable NSDictionary<?,​?> decodeDictionaryWithKeysOfClassObjectsOfClassForKey​(@NotNull
                                                                                                     @NotNull org.moe.natj.objc.Class keyCls,
                                                                                                     @NotNull
                                                                                                     @NotNull org.moe.natj.objc.Class objectCls,
                                                                                                     @NotNull
                                                                                                     @NotNull java.lang.String key)
        Decodes the \c NSDictionary object for the given \c key, which should be an \c NSDictionary , with keys of type given in \c keyCls and objects of the given non-collection class \c objectCls (no nested dictionaries or other dictionaries contained in the dictionary, etc) from the coder. Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn. Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder. API-Since: 14.0
      • decodeDictionaryWithKeysOfClassesObjectsOfClassesForKey

        @Nullable
        public @Nullable NSDictionary<?,​?> decodeDictionaryWithKeysOfClassesObjectsOfClassesForKey​(@NotNull
                                                                                                         @NotNull NSSet<? extends org.moe.natj.objc.Class> keyClasses,
                                                                                                         @NotNull
                                                                                                         @NotNull NSSet<? extends org.moe.natj.objc.Class> objectClasses,
                                                                                                         @NotNull
                                                                                                         @NotNull java.lang.String key)
        Decodes the \c NSDictionary object for the given \c key, which should be an \c NSDictionary, with keys of the types given in \c keyClasses and objects of the given non-collection classes in \c objectClasses (no nested dictionaries or other dictionaries contained in the dictionary, etc) from the given coder. Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn. Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder. API-Since: 14.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.