Class: module:Rule

ngeo.rule.module:Rule.ngeo.rule.module:Rule

new module:Rule(options)

The abstract class for all filter rules.

Rules are used to define filters that can be applied on data sources. A rule is usually a combination of 3 things:

  • a property name, for example 'city_name'
  • an operator, for example 'is equal to'
  • and an expression, for example 'Chicoutimi'.

A rule is useful to hold those properties and change them on the fly. For example, changing an operator from 'is equal to' to 'like'.

Also, a rule is especially useful for its value getter, which returns the combination of properties described above or null if there are some missing. The value getter can be watched and used when the value is not null.

When the operator is between, the lowerBoundary and upperBoundary properties are used instead of expression.

Parameters:
Name Type Description
options !ngeox.rule.RuleOptions

Options.

Implements:

Members

active

active

expression: number|string

The expression of the rule. The expression and boundaries are mutually exclusives.

Note: exported (instead of private) due to the problem with the compiler. See the getter/setter methods below... As a setter, the expression property would support being bond to an ng-model. Without it, it can't unless we expose the property directly.

isCustom

(protected) listenerKeys: Array:.<!ol.EventsKey:>

lowerBoundary

lowerBoundary

name

operator

operator

operators

propertyName

type

upperBoundary

upperBoundary

value

Methods

destroy()

getExpression()

The expression property does not have conventionnal getter/setters method because of a limitation of the compiler. It doesn't support yet having such methods being extended in child classes.

See: https://github.com/google/closure-compiler/issues/1089

Returns:
?number|string

Expression

reset()

Reset the following properties to null: expression, lowerBoundary, upperBoundary.

setExpression(expression)

Parameters:
Name Type Description
expression ?number|string

Expression