net.groboclown.xml.xdstates.v1.modules
Class ASetPropertyValue

java.lang.Object
  |
  +--net.groboclown.xml.xdstates.v1.modules.ASetPropertyValue
All Implemented Interfaces:
IAttributeModule

public class ASetPropertyValue
extends Object
implements IAttributeModule

This module sets a property, where the property and value to be set is in the argument, of the form "name:value", where the separator character is a colon (':').

Version:
Alpha 0.9.0 - JDK 1.0+
Author:
Matt Albrecht

Constructor Summary
ASetPropertyValue()
           
 
Method Summary
 IAttributeModule copy()
          Copy the current module, and reset the new module's state as if fire( String, IDataList ) has never been called.
 IDataList fire(String value, IDataList list)
          Perform the specific permutation of the given data list.
 boolean hasAnotherState()
          The containing application will ensure that this will only be called after each fire( String, IDataList ) call.
 void registerValueModule(IValueModule module)
          Register the given value module with this module.
 boolean shouldFireTreeParse(String value, IDataList list)
          Determines if the tree at the node in the list should be fired.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

ASetPropertyValue

public ASetPropertyValue()
Method Detail

registerValueModule

public void registerValueModule(IValueModule module)
Register the given value module with this module. The attribute module does not have to accept the module, and can throw an IllegalArgumentException if it is incorrect.
Specified by:
registerValueModule in interface IAttributeModule

copy

public IAttributeModule copy()
Copy the current module, and reset the new module's state as if fire( String, IDataList ) has never been called.
Specified by:
copy in interface IAttributeModule

hasAnotherState

public boolean hasAnotherState()
The containing application will ensure that this will only be called after each fire( String, IDataList ) call. The fire( String, IDataList ) call should store this result at the end of the fire( String, IDataList ) method.
Specified by:
hasAnotherState in interface IAttributeModule
Returns:
true if this attribute knows of another state to transform the inner data.
See Also:
fire( String, IDataList )

shouldFireTreeParse

public boolean shouldFireTreeParse(String value,
                                   IDataList list)
Determines if the tree at the node in the list should be fired. At the point this is called, the list contains no IItems. If any attribute returns false, then the tree and its sub-nodes are not fired. However, if all the attributes return true from this method, then the tree and its sub-nodes are fired.

This is useful for performing conditional branching on a tree to prevent the sub-nodes for executing any actions which may be undesired (such as property adjustments).

Specified by:
shouldFireTreeParse in interface IAttributeModule

fire

public IDataList fire(String value,
                      IDataList list)
Perform the specific permutation of the given data list. The implementation must store the state of the next hasAnotherState() at the end of this method.
Specified by:
fire in interface IAttributeModule
Returns:
the new list after the attribute performs its modifications.


Written under the LGPL