WebObjects 5.4.2

Class EONotQualifier

  extended by com.webobjects.eocontrol.EOQualifier
      extended by com.webobjects.eocontrol.EONotQualifier
All Implemented Interfaces:
EOKeyValueArchiving, EOQualifierEvaluation, NSCoding, Serializable

public class EONotQualifier
extends EOQualifier
implements NSCoding, EOKeyValueArchiving

EONotQualifier is a subclass of EOQualifier that contains a single qualifier. When an EONotQualifier object is evaluated, it returns the inverse of the result obtained by evaluating the qualifier it contains.

EONotQualifier implements the EOQualifierEvaluation interface, which defines the method evaluateWithObject for in-memory evaluation. When an EONotQualifier object receives an evaluateWithObject message, it evaluates the given object to determine if it satisfies the qualifier criteria.

You can generate SQL code for an EONotQualifier using the EOSQLExpression static method sqlStringForNegatedQualifier.

See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOQualifier
EOQualifier.Comparison, EOQualifier.ComparisonSupport, EOQualifier.QualifierVariableSubstitutionException
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
Field Summary
Fields inherited from class com.webobjects.eocontrol.EOQualifier
QualifierOperatorCaseInsensitiveLike, QualifierOperatorContains, QualifierOperatorEqual, QualifierOperatorGreaterThan, QualifierOperatorGreaterThanOrEqualTo, QualifierOperatorLessThan, QualifierOperatorLessThanOrEqualTo, QualifierOperatorLike, QualifierOperatorNotEqual
Constructor Summary
EONotQualifier(EOQualifier qualifier)
          Creates and returns a new EONotQualifier.
Method Summary
 void addQualifierKeysToSet(NSMutableSet qualKeys)
          Adds the receiver's qualifier keys to qualKeys.
 Class classForCoder()
          Allows the receiver, before being encoded, to substitute a class other than its own in a coder.
static Object decodeObject(NSCoder coder)
static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
 void encodeWithCoder(NSCoder coder)
          Encodes the receiver using coder.
 void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
          Asks the receiver to archive its state into the EOKeyValueArchiver archiver.
 boolean equals(Object other)
 boolean evaluateWithObject(Object object)
          Returns true if the object object satisfies the EONotQualifier, false otherwise.
 EOQualifier qualifier()
 EOQualifier qualifierWithBindings(NSDictionary bindings, boolean requiresAll)
          Returns a new qualifier substituting all variables with values found in bindings.
 String toString()
          Converts the receiver to a string.
 void validateKeysWithRootClassDescription(EOClassDescription classDesc)
          Ensures that the receiver contains keys and key paths that belong to or originate from classDesc.
Methods inherited from class com.webobjects.eocontrol.EOQualifier
allQualifierKeys, allQualifierOperators, bindingKeys, clone, filterArrayWithQualifier, filteredArrayWithQualifier, keyPathForBindingKey, operatorSelectorForSelectorNamed, operatorSelectorForString, qualifierToMatchAllValues, qualifierToMatchAnyValue, qualifierWithQualifierFormat, relationalQualifierOperators, stringForOperatorSelector
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public EONotQualifier(EOQualifier qualifier)
Creates and returns a new EONotQualifier.

If qualifier is specified, it is used as the qualifier. For example, the following code excerpt constructs a qualifier, baseQual, and uses it to initialize an EONotQualifier, negQual. The EONotQualifier negQual is then used to filter an in-memory array. The code excerpt returns an array of Guest objects whose lastName properties do not have the same value as the lastName property of the guest's sponsoring member (this example is based on the Rentals sample database). In other words, the EONotQualifier negQual inverts the effects of baseQual.

NSArray guests EOQualifier baseQual; EONotQualifier negQual; baseQual = EOQualifier.qualifierWithQualifierFormat(lastName = member.lastName, null); negQual = new EONotQualifier(baseQual); return EOQualifier.filteredArrayWithQualifier(guests, negQual);

qualifier - abstract class for objects that hold information used to restrict selections on objects or database rows according to specified criteria.
Method Detail


public EOQualifier qualifier()
the inverted qualifier


public boolean equals(Object other)
equals in class Object
other - target of comparison
true if this qualifier is equal to the input object


public boolean evaluateWithObject(Object object)
Returns true if the object object satisfies the EONotQualifier, false otherwise. This method can throw one of several possible exceptions if an error occurs. If the application allows users to construct arbitrary qualifiers (such as through a user interface), you may want to write code to catch any exceptions and respond to errors (for example, by displaying a panel saying that the user typed a poorly formed qualifier).

Specified by:
evaluateWithObject in interface EOQualifierEvaluation
evaluateWithObject in class EOQualifier
object - the input object
true if the object object satisfies the EONotQualifier, false otherwise
exception - when an error occurs


public String toString()
Converts the receiver to a string.

toString in class Object
the string corresponding to the qualifier


public void validateKeysWithRootClassDescription(EOClassDescription classDesc)
Ensures that the receiver contains keys and key paths that belong to or originate from classDesc. This method raises an exception if an unknown key is found, otherwise it returns null to indicate that the keys contained by the qualifier are valid.

Specified by:
validateKeysWithRootClassDescription in class EOQualifier
classDesc - bridge between enterprise objects and the metadata contained in an external source of information.
exception - if unknown key is found


public EOQualifier qualifierWithBindings(NSDictionary bindings,
                                         boolean requiresAll)
Returns a new qualifier substituting all variables with values found in bindings. If requiresAll is true, any variable not found in bindings throws an exception. If requiresAll is false, missing variable values cause the qualifier node to be pruned from the tree.

Specified by:
qualifierWithBindings in class EOQualifier
bindings - the input array with bindings
requiresAll - true if all the values are required, false otherwise
the EOQualifier object with the bindings


public void addQualifierKeysToSet(NSMutableSet qualKeys)
Adds the receiver's qualifier keys to qualKeys. The subclasses in the EOControl framework do this by traversing the tree of qualifiers. Node qualifiers (such as EOAndQualifier) recursively invoke this method until they reach a leaf qualifier (such as EOKeyValueQualifier) which adds its key to the set.

Subclasses of EOQualifier must implement this method.

Specified by:
addQualifierKeysToSet in class EOQualifier
qualKeys - input array of qualifier keys


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
the substituted class


public static Object decodeObject(NSCoder coder)
coder - input array of data
object created from the data in the coder


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
coder - the input array with data
See Also:


public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
Description copied from interface: EOKeyValueArchiving
Asks the receiver to archive its state into the EOKeyValueArchiver archiver.

Specified by:
encodeWithKeyValueArchiver in interface EOKeyValueArchiving
archiver - destination for archived qualifier
See Also:


public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
unarchiver - source of archived qualifier
object decoded from unarchiver

Last updated June 2008

Copyright © 2000-2008 Apple Inc.