Project Wonder 5.0

er.directtoweb.assignments
Class ERDKeyValueAssignment

java.lang.Object
  extended by com.webobjects.directtoweb.Assignment
      extended by er.directtoweb.assignments.ERDKeyValueAssignment
All Implemented Interfaces:
com.webobjects.eocontrol.EOKeyValueArchiving, java.io.Serializable

public class ERDKeyValueAssignment
extends com.webobjects.directtoweb.Assignment

Piece of crap. This assignment works around the fact that KeyValueAssignment isn't public (and should be). Use this assignment as a drop in replacement for KeyValueAssignment. Note that this assignment is not a delayed assignment and as such the value returned by this assignment will be cached the first time this assignment is fired. To have a key value assignment that does not cache the value returned the first time have a look at ERDDelayedKeyValueAssignment.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
com.webobjects.eocontrol.EOKeyValueArchiving._NullValueSupport, com.webobjects.eocontrol.EOKeyValueArchiving._NumberSupport, com.webobjects.eocontrol.EOKeyValueArchiving._TimestampSupport, com.webobjects.eocontrol.EOKeyValueArchiving.Awaking, com.webobjects.eocontrol.EOKeyValueArchiving.FinishInitialization, com.webobjects.eocontrol.EOKeyValueArchiving.Support
 
Field Summary
 
Fields inherited from class com.webobjects.directtoweb.Assignment
KeyPathKey, ValueKey
 
Fields inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
_CLASS
 
Constructor Summary
ERDKeyValueAssignment(com.webobjects.eocontrol.EOKeyValueUnarchiver eokeyvalueunarchiver)
          Public constructor
ERDKeyValueAssignment(java.lang.String s, java.lang.String s1)
          Public constructor
 
Method Summary
static java.lang.Object decodeWithKeyValueUnarchiver(com.webobjects.eocontrol.EOKeyValueUnarchiver eokeyvalueunarchiver)
          Static constructor required by the EOKeyValueUnarchiver interface.
 java.lang.Object fire(com.webobjects.directtoweb.D2WContext d2wcontext)
          Fires the assignment.
 
Methods inherited from class com.webobjects.directtoweb.Assignment
encodeWithKeyValueArchiver, keyPath, toString, value, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERDKeyValueAssignment

public ERDKeyValueAssignment(java.lang.String s,
                             java.lang.String s1)
Public constructor

Parameters:
s - context key
s1 - value to be invoke on the context when firing.

ERDKeyValueAssignment

public ERDKeyValueAssignment(com.webobjects.eocontrol.EOKeyValueUnarchiver eokeyvalueunarchiver)
Public constructor

Parameters:
eokeyvalueunarchiver - key-value unarchiver used when unarchiving from rule files.
Method Detail

decodeWithKeyValueUnarchiver

public static java.lang.Object decodeWithKeyValueUnarchiver(com.webobjects.eocontrol.EOKeyValueUnarchiver eokeyvalueunarchiver)
Static constructor required by the EOKeyValueUnarchiver interface. If this isn't implemented then the default behavior is to construct the first super class that does implement this method. Very lame.

Parameters:
eokeyvalueunarchiver - to be unarchived
Returns:
decoded assignment of this class

fire

public java.lang.Object fire(com.webobjects.directtoweb.D2WContext d2wcontext)
Fires the assignment. In this case this method calls valueForKeyPath on the passed in context using the value() as the key.

Overrides:
fire in class com.webobjects.directtoweb.Assignment
Parameters:
d2wcontext - current context
Returns:
result of resolving the key path off of the context.

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.