public class ParameterDisplayRule
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
ParameterDisplayRule() |
ParameterDisplayRule(java.lang.String property,
java.lang.Object value) |
ParameterDisplayRule(java.lang.String logic,
java.lang.String property,
boolean negative) |
ParameterDisplayRule(java.lang.String logic,
java.lang.String property,
java.lang.Object[] values,
boolean negative) |
ParameterDisplayRule(java.lang.String logic,
java.lang.String property,
java.lang.Object[] values,
boolean negative,
PropertyLocation location)
Construct a Display Rule.
|
ParameterDisplayRule(java.lang.String logic,
java.lang.String property,
java.lang.Object value,
boolean negative) |
ParameterDisplayRule(java.lang.String logic,
java.lang.String property,
java.lang.Object value,
boolean negative,
PropertyLocation location) |
Modifier and Type | Method and Description |
---|---|
void |
addRule(ParameterDisplayRule newRule) |
void |
addValues(java.lang.Object... objects) |
java.util.List<ParameterDisplayRule> |
getDisplayRules()
Can have child display rules if we are looking at a complex rule.
|
java.lang.String |
getLogic()
is this an AND or OR from the previous piece of logic
|
java.lang.String |
getProperty()
Property to compare to, a listener will be created on this property
|
PropertyLocation |
getPropertyLocation()
Used to determine which model a property will be located in, useful if there are duplicate
properties in multiple sections/panels.
|
java.util.List<java.lang.Object> |
getValues()
Values that we want or don't want
|
boolean |
isNegative()
Determines if we are searching for the value, or not for the value
For example
values: ['5']
negative: false
the if statement would be
if(i == 5)
values: ['5'],
negative:true
The if statement would be
if(i != 5)
|
void |
setDisplayRules(java.util.List<ParameterDisplayRule> rules) |
void |
setLogic(java.lang.String logic) |
void |
setNegative(boolean negative) |
void |
setProperty(java.lang.String property) |
void |
setPropertyLocation(PropertyLocation propertyLocation) |
void |
setValues(java.util.List<java.lang.Object> values) |
public ParameterDisplayRule()
public ParameterDisplayRule(java.lang.String property, java.lang.Object value)
public ParameterDisplayRule(java.lang.String logic, java.lang.String property, java.lang.Object value, boolean negative)
public ParameterDisplayRule(java.lang.String logic, java.lang.String property, boolean negative)
public ParameterDisplayRule(java.lang.String logic, java.lang.String property, java.lang.Object value, boolean negative, PropertyLocation location)
public ParameterDisplayRule(java.lang.String logic, java.lang.String property, java.lang.Object[] values, boolean negative)
public ParameterDisplayRule(java.lang.String logic, java.lang.String property, java.lang.Object[] values, boolean negative, PropertyLocation location)
logic
- Used to specify the operator when there are multiple "child" display rules within this
instance of ParameterDisplayRule. Logic may be AND or OR. If there are three child rules and
logic is AND, each rule will be evaluated individually and the results will be combined as :
Rule1Result && Rule2Result && Rule3Result property
- specifies the "other" parameter to be inspected by this display rule. Every Parameter
instance has an identifier for its value. For example, whatever the user types into a Text Input
parameter may be referenced using the identifier "SOURCE" if it is specified as its property.values
- is an array of values for comparison. Each value in the array is compared against the
"other" parameter for equality. They are then combined using the OR operator.negative
- inverts the result obtained after comparing vals against the "other" parameter.negative | result |
true | property != null && property != 0 |
false | property == null || property == 0 |
location
- An instance of PropertyLocation
, used to determine where the "other" parameter is located.
This is useful if there are parameters having the same property in multiple sections/panels.
If this is null, it is assumed the property is in the same location as the parent of this ParameterDisplayRule.public void addValues(java.lang.Object... objects)
public void addRule(ParameterDisplayRule newRule)
public java.lang.String getLogic()
public void setLogic(java.lang.String logic)
public java.lang.String getProperty()
public void setProperty(java.lang.String property)
public java.util.List<java.lang.Object> getValues()
public void setValues(java.util.List<java.lang.Object> values)
public java.util.List<ParameterDisplayRule> getDisplayRules()
public void setDisplayRules(java.util.List<ParameterDisplayRule> rules)
public boolean isNegative()
public void setNegative(boolean negative)
public PropertyLocation getPropertyLocation()
public void setPropertyLocation(PropertyLocation propertyLocation)