target object
that will be registered with registerFilterTarget method.
Internal implementation of appliedFiltersMap
Specifies was appliedFiltersMap already constructed or not.
Global collection of all filters configuration.
Used to build appliedFiltersMap for concrete set of objects that were registered as target objects
via registerFilterTarget for concrete service instance.
Collection of FilterConfig settings that matches configuration for all objects that were registered in current service instance via registerFilterTarget method.
This collection is also filled up with configurations of passed target objects
base classes since config applicability is determined by instanceof
check.
This collection is "lazy" and will be filled up on first call of resetValues, applyParams or getRequestState method.
Goes through all target properties
of all target objects
and tries to find property within passed object which name is equal
to configured FilterConfig.parameterName.
If match is found, value of the property from passed object is applied to target property
in accordance with
FilterConfig.ignoreOnAutoMap, FilterConfig.emptyIsNull, FilterConfig.coerce, FilterConfig.parseFormatter.
object with values to apply.
Builds map of settings for passed target object
.
Builds final map of settings for objects that were registered as target objects
.
This method is called automatically before first usage of appliedFiltersMap.
Performs service destroy.
Goes through all target properties
of all target objects
and applies their values to one resulted object literal.
Typical usage of this method is building request to send it to the server.
Names of properties in result object depends on FilterConfig.parameterName. Final values would be constructed by buildFilterValue method.
optional function to filter applied values.
resulted object literal.
Registers passed object as target object
for current service instance.
getRequestState method will compose result from objects that were registered by this method.
applyParams and resetValues methods processes registered objects that were registered by this method.
object(s) to register as target object
.
Removes passed object from target objects
collection for current service instance.
This means that getRequestState, applyParams and resetValues methods stops to process this objects.
object(s) to remove from collection of target object
.
Goes through all target properties
of all target objects
and sets their values to configured default.
Default value will be determined as:
target property
at the moment of first call of
resetValues, applyParams or getRequestState.This method performs next actions:
target object
as this
scope. If specified value is not a function it will be used by itself.target property
.Used to build resulted value of target property
based on specified FilterConfig.
This method is used by getRequestState and also calls oneself for the case of array values.
In addition to FilterConfig configuration, this method checks if target property
has method toRequest()
. If so this method will be used to get serialized value.
This convention has sense in several scenarios:
toRequest
in Date
prototype.This gives ability to easily send Date
objects to the server in appropriate format which server can apply or, for example, always send UTC-dates.
But be accurate with this approach. There's a lot of problems with extending of embedded types.
target object
which holds specified target property
. Used as this
scope for FilterConfig.serializeFormatter method.
raw value of target property
.
filter configuration for target property
.
Used to register type property as target property
with specified filter config for later usage with FiltersService.
This method is called by filter annotation, for example.
type definition that contains specified property declaration.
configuration for property as a filter.
Generated using TypeDoc
Used for declarative building of objects which represent valuable state of
target object
.Since this declaration is pretty abstract and hard to understand, let's look at a specific sample.
Typical usage of this service is something like this:
class EndUserClass { @filter public parameter1 = 'Hey'; @filter public parameter2 = 'There'; } let endUserClassInstance = new EndUserClass(); let filterService = new FilterService(endUserClassInstance);
Now we can use created
filtersService
instance for several cases:{ parameter1: 'Hey', parameter2: 'There' }