WebObjects 5.4.2

com.webobjects.eocontrol
Class EOQualifierVariable

java.lang.Object
  extended by com.webobjects.eocontrol.EOQualifierVariable
All Implemented Interfaces:
EOKeyValueArchiving, NSCoding, Serializable

public class EOQualifierVariable
extends Object
implements Serializable, NSCoding, EOKeyValueArchiving

EOQualifierVariable defines objects that serve as placeholders in the qualifier. When you create a qualifier programmatically, you typically do something like this:

aQual = EOQualifier.qualifierWithQualifierFormat(aDate);

where aDate is a variable that contains the actual date you want to query upon. When you store the qualifier in an EOModel, there is no way to know the actual value to query upon or the variable that will contain that value. The EOQualifierVariable object acts as a placeholder for the actual variable that will represent the right side of the expression. An EOQualifierVariable is specified by using a dollar sign ($), as in the following:

dateReleased = $aDate

Variable values must be substituted for using qualifierWithBindings.

See Also:
EOQualifier.qualifierWithBindings(NSDictionary bindings, boolean requiresAll), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
NSCoding.Support
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Constructor Summary
EOQualifierVariable(String key)
          Creates and returns a new EOQualifierVariable object with the specified name.
 
Method Summary
 Class classForCoder()
          Allows the receiver to substitute a class other than its own (for example, a public superclass) for use during archiving (encoding) by an NSCoder.
static Object decodeObject(NSCoder coder)
          (Re)creates an object based on type information and data stored in coder.
static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
          Conforms to EOKeyValueArchiving.
 void encodeWithCoder(NSCoder coder)
          Archives the receiver's type information and data into coder.
 void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
          Conforms to EOKeyValueArchiving.
 boolean equals(Object other)
          If the receiver and the other object have equals keys it returns true, false otherwise.
 String key()
          Returns the specified name for the EOQualifierVariable object
 String toString()
          String representation of the name for the EOQualifierVariable object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EOQualifierVariable

public EOQualifierVariable(String key)
Creates and returns a new EOQualifierVariable object with the specified name. For example, if the qualifier "isdateReleased = $aDate", then this method would be invoked with the key "aDate".

Parameters:
key - the specified name for the EOQualifierVariable object
Method Detail

toString

public String toString()
String representation of the name for the EOQualifierVariable object.

Overrides:
toString in class Object
Returns:
a String representing the name for the EOQualifierVariable object

equals

public boolean equals(Object other)
If the receiver and the other object have equals keys it returns true, false otherwise.

Overrides:
equals in class Object
Returns:
true if both the receiver and the other object key are equal

key

public String key()
Returns the specified name for the EOQualifierVariable object

Returns:
the key for the EOQualifierVariable object

classForCoder

public Class classForCoder()
Allows the receiver to substitute a class other than its own (for example, a public superclass) for use during archiving (encoding) by an NSCoder. Default is the value of the getClass method.

Specified by:
classForCoder in interface NSCoding
Returns:
the Class to be used with an NSCoder
See Also:
EOQualifierVariable.encodeWithCoder(NSCoder coder), EOQualifierVariable.decodeObject(NSCoder coder), NSCoder, NSCoding

decodeObject

public static Object decodeObject(NSCoder coder)
(Re)creates an object based on type information and data stored in coder.

Parameters:
coder - stores object type information along with an object's data
Returns:
an object (re)created from the data in coder.
See Also:
EOQualifierVariable.encodeWithCoder(NSCoder coder), NSCoder, NSCoding

encodeWithCoder

public void encodeWithCoder(NSCoder coder)
Archives the receiver's type information and data into coder. The receiver can then be recreated using decodeObject. Custom type information can be used by overriding classForCoder.

Specified by:
encodeWithCoder in interface NSCoding
Parameters:
coder - stores object type information along with an object's data
See Also:
EOQualifierVariable.decodeObject(NSCoder coder), EOQualifierVariable.classForCoder(), NSCoder, NSCoding

encodeWithKeyValueArchiver

public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
Conforms to EOKeyValueArchiving.

Specified by:
encodeWithKeyValueArchiver in interface EOKeyValueArchiving
Parameters:
archiver - the EOKeyValueArchiver object with which to encode the receiver
See Also:
EOKeyValueArchiver

decodeWithKeyValueUnarchiver

public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
Conforms to EOKeyValueArchiving.

Parameters:
unarchiver - the EOKeyValueArchiver object with which to decode the receiver
Returns:
the unarchived EOAndQualifier object

Last updated June 2008

Copyright © 2000-2008 Apple Inc.