PATH |
Assignment
Package: com.webobjects.directtowebInherits from:java.lang.Object
Subclasses:
Class Description
This class performs assignments on the right-hand side of rules. Every rule in the rule database has an instance of this class that holds the right-hand-side key and the right-hand-side value. The rule engine uses this class; you should never need to use it.
If you need custom assignment behavior you can subclass
Assignment (String keyPath, Object value)
Assignment (EOKeyValueUnarchiver unarchiver)
You can invoke super
for each.
You can then override the fire
method to provide the value. For example, if you define a method myMethod
that returns the right-hand-side value myValue
for a key, the fire
method could look like:
public Object fire(D2WContext context) { if (value().equals("myValue")) return myMethod(context); }
Method Types
Constructors
- public Assignment(String keyPath, Object value)
- Assignment()
- public Assignment(EOKeyValueUnarchiver unarchiver)
Static Constants
Assignment Parameters
Firing the Rule
Private Methods
Constructors
Assignment
public Assignment(String keyPath, Object value)
Creates an
Assignment
Assignment()
Standard Java no-argument constructor.
Assignment
public Assignment(EOKeyValueUnarchiver unarchiver)
Creates a
Static Constants
keyPathKey
java.lang.String
This constant is intentionally undocumented.
valueKey
java.lang.String
This constant is intentionally undocumented.
Methods
encodeWithKeyValueArchiver
public Object encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
This method is intentionally undocumented. You should never have to invoke or customize it.
fire
public Object fire(D2WContext context)
This method is invoked when a rule fires. It returns the right-hand-side value (an
context
Direct to Web context.You can override this method to provide your own assignments.
keyPath
public String keyPath()
Returns the receiver's right-hand-side key.
toString
public String toString()
Returns a
D2WTraceRuleFiringEnabled
user default is set to YES
.
value
public Object value(D2WContext context)
Returns the receiver's right-hand-side value.
© 2001 Apple Computer, Inc.