@Incubating open class RuleSource
A marker type for a class that is a collection of rules.
A rule source is not used like a regular Java object. It is a stateless container of methods and possibly constants.
Please consult the “Rule based model configuration” chapter of the Gradle User Guide for general information about “rules”.
Rule methodsEach method that is annotated with one of the following is considered a rule:
Each annotation specifies the type of the rule, which affects when it will be executed.
The following constraints apply to all rule methods:
static
or not; it makes no difference.void
return type.See Model for information on the significance of the return type of a Model method.
Subjects and inputsMethod rules declare the subject and any inputs as parameters to the method. With the exception of Model methods, the subject of the rule is the, required, first parameter and all subsequent parameters are inputs. For a non-void Model method, the subject (i.e. model element being created) is the return object. For a void Model method, the subject is the first method parameter.
The Path annotation can be placed on any parameter (except the subject of Model rules) to indicate the model element to bind to. If there is no Path annotation, a “by-type” binding will be attempted. The binding scope is determined by how the rule source is applied.
General class constraintsAlong with the constraints on individual rule methods by their associated annotation, the following are general constraints of rule source implementations:
RuleSource()
A marker type for a class that is a collection of rules. A rule source is not used like a regular Java object. It is a stateless container of methods and possibly constants. Please consult the “Rule based model configuration” chapter of the Gradle User Guide for general information about “rules”. Rule methodsEach method that is annotated with one of the following is considered a rule:
Each annotation specifies the type of the rule, which affects when it will be executed. The following constraints apply to all rule methods:
See Model for information on the significance of the return type of a Model method. Subjects and inputsMethod rules declare the subject and any inputs as parameters to the method. With the exception of Model methods, the subject of the rule is the, required, first parameter and all subsequent parameters are inputs. For a non-void Model method, the subject (i.e. model element being created) is the return object. For a void Model method, the subject is the first method parameter. The Path annotation can be placed on any parameter (except the subject of Model rules) to indicate the model element to bind to. If there is no Path annotation, a “by-type” binding will be attempted. The binding scope is determined by how the rule source is applied. General class constraintsAlong with the constraints on individual rule methods by their associated annotation, the following are general constraints of rule source implementations:
|
open class JvmTestSuiteBasePlugin : RuleSource
The base plugin that needs to be applied by all plugins which provide testing support for the Java software model. |
|
open class PlayDistributionPlugin : RuleSource
A plugin that adds a distribution zip to a Play application build. |
|
open class PlayRoutesPlugin : RuleSource
Plugin for compiling Play routes sources in a Play application. |
|
open class PlayTestPlugin : RuleSource
Plugin for executing tests from a Play Framework application. |
|
open class PlayTwirlPlugin : RuleSource
Plugin for compiling Twirl sources in a Play application. |