ProAct.PropertyProvider Class
src/js/properties/property_provider.js:5
The ProAct.PropertyProvider is an abstract class.
Many providers can be registered for many kinds of properties.
When a ProAct.js object is initialized its fields are turned into properties.
Depending on the type and the name of the field, as well as meta information the valid
type of ProAct.Property is created and used.
The PropertyProviders have 'filter' method and depending on it the valid kind is decided.
ProAct.PropertyProvider is part of the proact-properties module of ProAct.js.
Constructor
ProAct.PropertyProvider
()
Item Index
Methods
- clearProviders static
- filter
- prependProvider static
- provide
- registerProvider static
- unregisterProvider static
Properties
Methods
clearProviders
()
static
Removes all ProAct.PropertyProviders from the list of the registered ProAct.PropertyProviders.
filter
-
object -
property -
meta
Used to check if this ProAct.PropertyProvider is compliant with the field and meta data
to be used for creating a ProAct.Property instance with
provide.
Abstract - must be implemented by an extender.
Parameters:
-
objectObjectThe object to which a new ProAct.Property instance should be provided.
-
propertyStringThe field name of the object to turn into a ProAct.Property. Can be used in the filtering process.
For example field name beginning with foo. Can be turned into a FooProperty.
-
metaString | ArrayMeta information to be used for filtering and configuration of the ProAct.Property instance to be provided.
Returns:
If this provider is compliant with the passed arguments.
prependProvider
-
propertyProvider
Registers a ProAct.PropertyProvider.
The provider is prepended in the beginning of the list of ProAct.PropertyProviders.
It's filtering will be called before any other registered provider.
Parameters:
-
propertyProviderProAct.PropertyProviderThe
ProAct.PropertyProviderto register.
provide
-
queueName -
object -
property -
meta
Provides an instance of ProAct.Property.
It should be called only after this filter method, called with the same arguments returns true.
Abstract - must be implemented in an extender.
Parameters:
-
queueNameStringThe name of the queue all the updates should be pushed to.
If this parameter is null/undefined the default queue of flow is used.
-
objectObjectThe object to which a new ProAct.Property instance should be provided.
-
propertyStringThe field of the object to turn into a ProAct.Property. Can be used in the filtering process.
-
metaString | ArrayMeta information to be used for filtering and configuration of the ProAct.Property instance to be provided.
Returns:
A property provided by this provider.
registerProvider
-
propertyProvider
Registers a ProAct.PropertyProvider.
The provider is appended in the end of the list of ProAct.PropertyProviders.
When a property must be provided if there is a ProAct.PropertyProvider registered before
the passed propertyProvider, with valid filtering for the passed field, it will
be used instead.
Parameters:
-
propertyProviderProAct.PropertyProviderThe
ProAct.PropertyProviderto register.
unregisterProvider
-
propertyProvider
Removes a ProAct.PropertyProvider from the list of the registered ProAct.PropertyProviders.
Parameters:
-
propertyProviderProAct.PropertyProviderThe ProAct.PropertyProvider to unregister.
proact.js