Class GroovySelectorFactory
java.lang.Object
ch.tocco.nice2.scripting.impl.groovy.selector.GroovySelectorFactory
- All Implemented Interfaces:
SelectorFactory
SelectorFactory
that creates selectors based on groovy expressions that
are evaluated using the GroovyEvaluationService
.-
Constructor Summary
ConstructorDescriptionGroovySelectorFactory
(Context context, GroovyEvaluationService groovyEvaluationService, org.slf4j.Logger log) -
Method Summary
-
Constructor Details
-
GroovySelectorFactory
public GroovySelectorFactory(Context context, @Lazy GroovyEvaluationService groovyEvaluationService, org.slf4j.Logger log)
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceSelectorFactory
-
createSelector
public Selector createSelector(@Nullable @Nullable String selectorType, String implementation) throws PersistException Description copied from interface:SelectorFactory
Creates an implementation of theSelector
interface based. The implementation is based on scripts defined in theselection
element of a relation model definition.- Specified by:
createSelector
in interfaceSelectorFactory
- Parameters:
selectorType
- the selector type ) in this case "script:js"implementation
- the implementation of the method as a string- Returns:
- the
Selector
with implementedSelector.isSelected(ch.tocco.nice2.model.entity.api.RelationModel, ch.tocco.nice2.model.entity.api.EntityReference, ch.tocco.nice2.model.entity.api.EntityReference)
method - Throws:
PersistException
-