org.jasig.services.persondir.support.rule
Class SimpleAttributeRule

java.lang.Object
  extended by org.jasig.services.persondir.support.rule.SimpleAttributeRule
All Implemented Interfaces:
AttributeRule

public final class SimpleAttributeRule
extends Object
implements AttributeRule

Sets a specified attribute to a specified value when a specified seed value matches a specified pattern.


Constructor Summary
SimpleAttributeRule(String whenKey, String whenPattern, String setKey, String setValue)
           
 
Method Summary
 boolean appliesTo(Map userInfo)
          Indicates whether the rule applies to the user described by the specified information.
 Map evaluate(Map userInfo)
          Applies the embodied rule to the user described by the specified information and returns the result.
 Set getPossibleUserAttributeNames()
          Indicates the complete set of user attribute names that may be returned by a call to evaluate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleAttributeRule

public SimpleAttributeRule(String whenKey,
                           String whenPattern,
                           String setKey,
                           String setValue)
Method Detail

appliesTo

public boolean appliesTo(Map userInfo)
Description copied from interface: AttributeRule
Indicates whether the rule applies to the user described by the specified information. Implementations of AttributeRule must not change the input Map. Implementations dictate the expected types for the Keys and Values of the Map.

Specified by:
appliesTo in interface AttributeRule
Parameters:
userInfo - immutable Map of attributes to values for the implementation to determine if this rule applies, must not be null.
Returns:
TRUE if this rule applies to the Map data, FALSE if not.

evaluate

public Map evaluate(Map userInfo)
Description copied from interface: AttributeRule
Applies the embodied rule to the user described by the specified information and returns the result. This method follows the same contract as org.jasig.portal.services.persondir.IPersonAttributeDao#getUserAttributes(Map)

Specified by:
evaluate in interface AttributeRule

getPossibleUserAttributeNames

public Set getPossibleUserAttributeNames()
Description copied from interface: AttributeRule
Indicates the complete set of user attribute names that may be returned by a call to evaluate. This method follows the same contract as org.jasig.portal.services.persondir.IPersonAttributeDao#getPossibleUserAttributeNames()

Specified by:
getPossibleUserAttributeNames in interface AttributeRule


Copyright © 1998-2007 Java Architectures Special Interest Group. All Rights Reserved.