
Public Member Functions | |
| NSDictionary< String, String > | compute (String key, String value, String parameters) |
| InRangeOperator (int value) | |
Static Public Attributes | |
| static final String | ForInstanceKey = "forInstance" |
Private Attributes | |
| int | _instanceNumber |
An example of this is instance-number-based properties, where you want to only set a specific value if the instance number of the application falls within a certain value. In this example, because instance number is something that is associated with a request rather than the application itself, it is up to the class registering this operator to specify which instance number this application is (via, for instance, a custom system property).
InRangeOperator supports specifying keys like:
er.extensions.akey.@forInstance.50=avalue
which would set the value of "er.extensions.akey" to "avalue" if this instance is 50.
er.extensions.akey.@forInstance.60,70=avalue
which would set the value of "er.extensions.akey" to "avalue" if this instance is 60 or 70.
er.extensions.akey.@forInstance.100-300=avalue
which would set the value of "er.extensions.akey" to "avalue" if this instance is between 100 and 300 (inclusive).
er.extensions.akey.@forInstance.20-30,500=avalue
which would set the value of "er.extensions.akey" to "avalue" if this instance is between 20 and 30 (inclusive), or if the instance is 50.
If there are multiple inRange operators that match for the same key, the last property (when sorted alphabetically by key name) will win. As a result, it's important to not define overlapping ranges, or you may get unexpected results.
| InRangeOperator | ( | int | value | ) |
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.
| 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") |
Implements ERXProperties.Operator.
int _instanceNumber [private] |
final String ForInstanceKey = "forInstance" [static] |
The default key name of the ForInstance variant of the InRange operator.
1.5.8