WebObjects 5.4.2

com.webobjects.foundation
Class NSKeyValueCoding.Null

java.lang.Object
  extended by com.webobjects.foundation.NSKeyValueCoding.Null
All Implemented Interfaces:
NSCoding, Serializable, Cloneable
Enclosing interface:
NSKeyValueCoding

public static final class NSKeyValueCoding.Null
extends Object
implements Serializable, Cloneable, NSCoding

NSKeyValueCoding.Null is a final class that defines a unique object used to represent null values in collection objects, such as NSArrays, which do not allow null values.

For instance, Enterprise Objects Framework uses NSKeyValueCoding.Null to represent null values from database rows in its database level snapshots (NSDictionary objects). However, Enterprise Objects Framework automatically translates NSKeyValueCoding.Null to null in enterprise objects, so you should rarely need to write code that accounts for this class.

Whenever null is represented by NSKeyValueCoding.Null, it should be represented with the instance stored in the NSKeyValueCoding constant, NullValue. You can safely use this instance with the == operator to test for the presence of a null value:

          <blockquote>
           if (value == NSKeyValueCoding.NullValue){
              //......
           }
           </blockquote>
 

See Also:
NSKeyValueCoding.NullValue, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
NSCoding.Support
 
Method Summary
 Class classForCoder()
          Allows the receiver, before being encoded, to substitute a class other than its own in a coder.
 Object clone()
          Simply returns the shared instance of NSKeyValueCoding.Null stored in the constant NullValue.
static Object decodeObject(NSCoder coder)
          Returns the shared instance of NSKeyValueCoding.Null stored in the NSKeyValueCoding constant NullValue.
 void encodeWithCoder(NSCoder coder)
          Encodes the receiver using coder.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string representation of the receiver

clone

public Object clone()
Simply returns the shared instance of NSKeyValueCoding.Null stored in the constant NullValue.

Overrides:
clone in class Object
Returns:
this
See Also:
NSKeyValueCoding.NullValue

classForCoder

public Class classForCoder()
Description copied from interface: NSCoding
Allows the receiver, before being encoded, to substitute a class other than its own in a coder. For example, private subclasses can substitute the name of a public superclass when being encoded.

Specified by:
classForCoder in interface NSCoding
Returns:
the class a coder should record

decodeObject

public static Object decodeObject(NSCoder coder)
Returns the shared instance of NSKeyValueCoding.Null stored in the NSKeyValueCoding constant NullValue.

Parameters:
coder - instructs the object to encode and decode its instance variables
Returns:
the shared instance of NSKeyValueCoding
See Also:
NSKeyValueCoding.NullValue, NSCoding

encodeWithCoder

public void encodeWithCoder(NSCoder coder)
Description copied from interface: NSCoding
Encodes the receiver using coder. Object type information along with an object's data is stored.

Specified by:
encodeWithCoder in interface NSCoding
Parameters:
coder - an NSCoder object that will be used to encode object of classes that implement this interface
See Also:
NSCoder

Last updated June 2008

Copyright © 2000-2008 Apple Inc.