|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.foundation.ERXProperties.InRangeOperator
public static class ERXProperties.InRangeOperator
InRangeOperator provides support for defining properties that only get set if a value falls within a specific range of values.
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.
Field Summary | |
---|---|
static java.lang.String |
ForInstanceKey
The default key name of the ForInstance variant of the InRange operator. |
Constructor Summary | |
---|---|
ERXProperties.InRangeOperator(int value)
Constructs a new InRangeOperator. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ForInstanceKey
Constructor Detail |
---|
public ERXProperties.InRangeOperator(int value)
value
- the instance number of this applicationMethod Detail |
---|
public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.String> compute(java.lang.String key, java.lang.String value, java.lang.String parameters)
ERXProperties.Operator
compute
in interface ERXProperties.Operator
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")
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |