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 java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

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

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

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

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

        public static 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

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

        public static java.lang.Object 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

        public NSSet<? extends org.moe.natj.objc.Class> allowedClasses()
        Get the current set of allowed classes.
      • allowsKeyedCoding

        public boolean allowsKeyedCoding()
      • containsValueForKey

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

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

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

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

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

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

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

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

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

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

        public CMTime decodeCMTimeForKey​(java.lang.String key)
      • decodeCMTimeMappingForKey

        public CMTimeMapping decodeCMTimeMappingForKey​(java.lang.String key)
      • decodeCMTimeRangeForKey

        public CMTimeRange decodeCMTimeRangeForKey​(java.lang.String key)
      • decodeDataObject

        public NSData decodeDataObject()
      • decodeDoubleForKey

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

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

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

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

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

        public long decodeIntegerForKey​(java.lang.String key)
      • decodeObject

        public java.lang.Object decodeObject()
      • decodeObjectForKey

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

        public java.lang.Object decodeObjectOfClassForKey​(org.moe.natj.objc.Class aClass,
                                                          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.
      • decodeObjectOfClassesForKey

        public java.lang.Object decodeObjectOfClassesForKey​(NSSet<? extends org.moe.natj.objc.Class> classes,
                                                            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:.
      • decodePropertyListForKey

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

        public java.lang.Object decodeTopLevelObjectAndReturnError​(org.moe.natj.general.ptr.Ptr<NSError> error)
      • decodeTopLevelObjectForKeyError

        public java.lang.Object decodeTopLevelObjectForKeyError​(java.lang.String key,
                                                                org.moe.natj.general.ptr.Ptr<NSError> error)
      • decodeTopLevelObjectOfClassForKeyError

        public java.lang.Object decodeTopLevelObjectOfClassForKeyError​(org.moe.natj.objc.Class aClass,
                                                                       java.lang.String key,
                                                                       org.moe.natj.general.ptr.Ptr<NSError> error)
      • decodeTopLevelObjectOfClassesForKeyError

        public java.lang.Object decodeTopLevelObjectOfClassesForKeyError​(NSSet<? extends org.moe.natj.objc.Class> classes,
                                                                         java.lang.String key,
                                                                         org.moe.natj.general.ptr.Ptr<NSError> error)
      • decodeUIEdgeInsetsForKey

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

        public UIOffset decodeUIOffsetForKey​(java.lang.String key)
      • decodeValueOfObjCTypeAt

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

        public void decodeValuesOfObjCTypes​(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.
      • encodeArrayOfObjCTypeCountAt

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

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

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

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

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

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

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

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

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

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

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

        public void encodeCMTimeForKey​(CMTime time,
                                       java.lang.String key)
      • encodeCMTimeMappingForKey

        public void encodeCMTimeMappingForKey​(CMTimeMapping timeMapping,
                                              java.lang.String key)
      • encodeCMTimeRangeForKey

        public void encodeCMTimeRangeForKey​(CMTimeRange timeRange,
                                            java.lang.String key)
      • encodeConditionalObject

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

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

        public void encodeDataObject​(NSData data)
      • encodeDoubleForKey

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

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

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

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

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

        public void encodeIntegerForKey​(long value,
                                        java.lang.String key)
      • encodeObject

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

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

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

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

        public void encodeUIOffsetForKey​(UIOffset offset,
                                         java.lang.String key)
      • encodeValueOfObjCTypeAt

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

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

        public 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).
      • failWithError

        public void failWithError​(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).
      • 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.
      • systemVersion

        public int systemVersion()
      • versionForClassName

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

        public NSDirectionalEdgeInsets decodeDirectionalEdgeInsetsForKey​(java.lang.String key)
      • decodeValueOfObjCTypeAtSize

        public void decodeValueOfObjCTypeAtSize​(java.lang.String type,
                                                org.moe.natj.general.ptr.VoidPtr data,
                                                long size)
      • encodeDirectionalEdgeInsetsForKey

        public void encodeDirectionalEdgeInsetsForKey​(NSDirectionalEdgeInsets insets,
                                                      java.lang.String key)
      • decodeArrayOfObjectsOfClassForKey

        public NSArray<?> decodeArrayOfObjectsOfClassForKey​(org.moe.natj.objc.Class cls,
                                                            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.
      • decodeArrayOfObjectsOfClassesForKey

        public NSArray<?> decodeArrayOfObjectsOfClassesForKey​(NSSet<? extends org.moe.natj.objc.Class> classes,
                                                              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.
      • decodeDictionaryWithKeysOfClassObjectsOfClassForKey

        public NSDictionary<?,​?> decodeDictionaryWithKeysOfClassObjectsOfClassForKey​(org.moe.natj.objc.Class keyCls,
                                                                                           org.moe.natj.objc.Class objectCls,
                                                                                           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.
      • decodeDictionaryWithKeysOfClassesObjectsOfClassesForKey

        public NSDictionary<?,​?> decodeDictionaryWithKeysOfClassesObjectsOfClassesForKey​(NSSet<? extends org.moe.natj.objc.Class> keyClasses,
                                                                                               NSSet<? extends org.moe.natj.objc.Class> objectClasses,
                                                                                               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.