Project Wonder 5.0

er.extensions.foundation
Interface ERXProperties.Operator

All Known Implementing Classes:
ERXProperties.EncryptedOperator, ERXProperties.InRangeOperator
Enclosing class:
ERXProperties

public static interface ERXProperties.Operator

Property operators work like array operators. In your properties, you can define keys like:

er.extensions.akey.@someOperatorKey.aparameter=somevalue

Which will be processed by the someOperatorKey operator. Because properties get handled very early in the startup process, you should register operators somewhere like a static block in your Application class. For instance, if you wanted to register the forInstance operator, you might put the following your Application class:

static { ERXProperties.setOperatorForKey(new ERXProperties.InRangeOperator(100), ERXProperties.InRangeOperator.ForInstanceKey); }

It's important to note that property operators evaluate at load time, not access time, so the compute function should not depend on any runtime state to execute. Additionally, access to other properties inside the compute method should be very carefully considered because it's possible that the operators are evaluated before all of the properties in the system are loaded.

Author:
mschrag

Method Summary
 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.String> compute(java.lang.String key, java.lang.String value, java.lang.String parameters)
          Performs some computation on the key, value, and parameters and returns a dictionary of new properties.
 

Method Detail

compute

com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.String> compute(java.lang.String key,
                                                                                  java.lang.String value,
                                                                                  java.lang.String parameters)
Performs some computation on the key, value, and parameters and returns a dictionary of new properties. If this method returns null, the original key and value will be used. If any other dictionary is returned, the properties in the dictionary will be copied into the destination properties.

Parameters:
key - the key ("er.extensions.akey" in "er.extensions.akey.@someOperatorKey.aparameter=somevalue")
value - ("somevalue" in "er.extensions.akey.@someOperatorKey.aparameter=somevalue")
parameters - ("aparameter" in "er.extensions.akey.@someOperatorKey.aparameter=somevalue")
Returns:
a dictionary of properties (or null to use the original key and value)

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

Copyright © 2002 – 2007 Project Wonder.