com.goodeast.webobjects.switchablestring
Class SSParentAssociation

java.lang.Object
  |
  +--com.webobjects.appserver.WOAssociation
        |
        +--com.goodeast.webobjects.switchablestring.SSParentAssociation
All Implemented Interfaces:
java.lang.Cloneable

public class SSParentAssociation
extends com.webobjects.appserver.WOAssociation

This class is used to work around the fact that two of the elements being subclassed are in fact subclasses of WOComponent, not WODynamicElement. As a result, they don't get an array of associations in their constructor,only bindings to the parent component. However, most of the code works correctly if it is passed WOAssociations, so this class serves as glue.


Field Summary
protected  java.lang.String _bindingName
          The name of the binding for this Association.
 
Fields inherited from class com.webobjects.appserver.WOAssociation
_BINDING_KEYPATH_PREFIX, _debugEnabled, _IsEventLoggingEnabled, TakeValueForKeyPathEvent, ValueForKeyPathEvent
 
Constructor Summary
SSParentAssociation(java.lang.String bindingName)
          Creates a new SSParentAssociation which can be used to access the binding bindingName.
 
Method Summary
 java.lang.String bindingInComponent(com.webobjects.appserver.WOComponent aComponent)
          Conformance to subclassing rules for WOAssociation.
 java.lang.String keyPath()
          Logs an error and continues, as we can't know the keyPath used by this binding based on the public WOComponent API's.
 void setValue(java.lang.Object value, com.webobjects.appserver.WOComponent aComponent)
          Sets the value for this binding in aComponent's parent component.
 java.lang.Object valueInComponent(com.webobjects.appserver.WOComponent aComponent)
          Returns the value for the binding evaluated in aComponent's parent component.
 
Methods inherited from class com.webobjects.appserver.WOAssociation
_bindingName, _debugDescription, _declarationName, _declarationType, _hasBindingInParent, _isImplementedForComponent, _logPullValue, _logPushValue, _markStartOfEventIfNeeded, _setDebuggingEnabled, _setValueNoValidation, associationWithKeyPath, associationWithValue, booleanValueInComponent, isValueConstant, isValueConstantInComponent, isValueSettable, isValueSettableInComponent, setDebugEnabledForBinding, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_bindingName

protected java.lang.String _bindingName
The name of the binding for this Association.

Constructor Detail

SSParentAssociation

public SSParentAssociation(java.lang.String bindingName)
Creates a new SSParentAssociation which can be used to access the binding bindingName.

Parameters:
bindingName - The name of the binding used by this association
Method Detail

bindingInComponent

public java.lang.String bindingInComponent(com.webobjects.appserver.WOComponent aComponent)
Conformance to subclassing rules for WOAssociation.

Specified by:
bindingInComponent in class com.webobjects.appserver.WOAssociation
Parameters:
aComponent - The WOComponent in which this association should be evaluated.
Returns:
The name of the binding for this association.

keyPath

public java.lang.String keyPath()
Logs an error and continues, as we can't know the keyPath used by this binding based on the public WOComponent API's.

Specified by:
keyPath in class com.webobjects.appserver.WOAssociation
Returns:
Always returns the string "unknown".

valueInComponent

public java.lang.Object valueInComponent(com.webobjects.appserver.WOComponent aComponent)
Returns the value for the binding evaluated in aComponent's parent component.

Overrides:
valueInComponent in class com.webobjects.appserver.WOAssociation
Parameters:
aComponent - The WOComponent whose parent the binding should be evaluated in.
Returns:
The value for the binding.

setValue

public void setValue(java.lang.Object value,
                     com.webobjects.appserver.WOComponent aComponent)
Sets the value for this binding in aComponent's parent component.

Overrides:
setValue in class com.webobjects.appserver.WOAssociation
Parameters:
value - The value to be set.
aComponent - The component whose parent should have the binding's value set.