ERXProperties.Operator Interface Reference

Inherited by ERXProperties.EncryptedOperator, and ERXProperties.InRangeOperator.

List of all members.

Public Member Functions

NSDictionary< String, Stringcompute (String key, String value, String parameters)


Detailed Description

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

Member Function Documentation

NSDictionary<String, String> compute ( String  key,
String  value,
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)

Implemented in ERXProperties.InRangeOperator, and ERXProperties.EncryptedOperator.


The documentation for this interface was generated from the following file:

Generated on Sat May 26 06:43:13 2012 for Project Wonder by  doxygen 1.5.8