com.metamatrix.common.actions
Class AddNamedObject

java.lang.Object
  extended by com.metamatrix.common.actions.ActionDefinition
      extended by com.metamatrix.common.actions.TargetedActionDefinition
          extended by com.metamatrix.common.actions.AddObject
              extended by com.metamatrix.common.actions.AddNamedObject
All Implemented Interfaces:
NamedObjectActionDefinition, java.io.Serializable, java.lang.Cloneable

public class AddNamedObject
extends AddObject
implements NamedObjectActionDefinition

This action definition specifies that the value of a named object reference in the target should be changed from the current object to a new object.

See Also:
Serialized Form

Constructor Summary
protected AddNamedObject(AddNamedObject rhs)
           
  AddNamedObject(java.lang.Object target, AttributeDefinition attribute, java.lang.Object[] args)
           
  AddNamedObject(java.lang.Object target, AttributeDefinition attribute, java.lang.String name, java.lang.Object newValue)
           
protected AddNamedObject(java.lang.Object target, java.lang.Integer attributeCode, java.lang.Object[] args)
           
 
Method Summary
 java.lang.Object clone()
          Return a deep cloned instance of this object.
 java.lang.String getActionDescription()
          Get the description (i.e., verb) for this type of action.
 java.lang.String getName()
           
 java.lang.Object getNewValue()
           
 ActionDefinition getUndoActionDefinition()
          Obtain the definition of the action that undoes this action definition.
 void setName(java.lang.String newName)
           
 java.lang.String toString()
          Returns a string representing the current state of the object.
 
Methods inherited from class com.metamatrix.common.actions.ActionDefinition
getArguments, getAttributeCode, getAttributeDescription, getCreationTime, getCreationTimeMillis, getTarget, hasArguments, hasAttributeCode, hasTarget
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddNamedObject

public AddNamedObject(java.lang.Object target,
                      AttributeDefinition attribute,
                      java.lang.String name,
                      java.lang.Object newValue)

AddNamedObject

public AddNamedObject(java.lang.Object target,
                      AttributeDefinition attribute,
                      java.lang.Object[] args)

AddNamedObject

protected AddNamedObject(java.lang.Object target,
                         java.lang.Integer attributeCode,
                         java.lang.Object[] args)

AddNamedObject

protected AddNamedObject(AddNamedObject rhs)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface NamedObjectActionDefinition

getNewValue

public java.lang.Object getNewValue()

setName

public void setName(java.lang.String newName)
Specified by:
setName in interface NamedObjectActionDefinition

getActionDescription

public java.lang.String getActionDescription()
Description copied from class: ActionDefinition
Get the description (i.e., verb) for this type of action.

Overrides:
getActionDescription in class AddObject
Returns:
the string description for this type of action.

toString

public java.lang.String toString()
Returns a string representing the current state of the object.

Overrides:
toString in class AddObject
Returns:
the string representation of this instance.

clone

public java.lang.Object clone()
Return a deep cloned instance of this object. Subclasses must override this method.

Overrides:
clone in class AddObject
Returns:
the object that is the clone of this instance.

getUndoActionDefinition

public ActionDefinition getUndoActionDefinition()
Obtain the definition of the action that undoes this action definition. If a modification action with the returned action definition is applied to the same target (when the state is such as that left by the original modification action), the resulting target will be left in a state that is identical to the target before either action were applied.

Overrides:
getUndoActionDefinition in class AddObject
Returns:
the action definition that undoes this action definition.


Copyright © 2009. All Rights Reserved.