本文整理匯總了Java中groovy.lang.Closure.DELEGATE_FIRST屬性的典型用法代碼示例。如果您正苦於以下問題:Java Closure.DELEGATE_FIRST屬性的具體用法?Java Closure.DELEGATE_FIRST怎麽用?Java Closure.DELEGATE_FIRST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類groovy.lang.Closure
的用法示例。
在下文中一共展示了Closure.DELEGATE_FIRST屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deploymentDescriptor
/**
* Configures the deployment descriptor for this EAR archive.
*
* <p>The given closure is executed to configure the deployment descriptor. The {@link DeploymentDescriptor} is passed to the closure as its delegate.</p>
*
* @param configureClosure The closure.
* @return This.
*/
public Ear deploymentDescriptor(@DelegatesTo(value = DeploymentDescriptor.class, strategy = Closure.DELEGATE_FIRST) Closure configureClosure) {
if (deploymentDescriptor == null) {
deploymentDescriptor = getInstantiator().newInstance(DefaultDeploymentDescriptor.class, getFileResolver(), getInstantiator());
}
ConfigureUtil.configure(configureClosure, deploymentDescriptor);
return this;
}
示例2: ClosureBackedAction
public ClosureBackedAction(Closure closure) {
this(closure, Closure.DELEGATE_FIRST, true);
}
示例3: reports
/**
* Configures the reports to be generated by this task.
*/
public PmdReports reports(@DelegatesTo(value = PmdReports.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
return reports(new ClosureBackedAction<PmdReports>(closure));
}
示例4: reports
/**
* Allow configuration of the report container by closure.
*
* <pre>
* reports {
* html {
* enabled false
* }
* xml.destination "build/reports/myReport.xml"
* }
* </pre>
*
* @param closure The configuration
* @return The report container
*/
T reports(@DelegatesTo(type="T", strategy = Closure.DELEGATE_FIRST) Closure closure);
示例5: reports
/**
* Configures the reports to be generated by this task.
*
* The contained reports can be configured by name and closures. Example:
*
* <pre>
* checkstyleTask {
* reports {
* html {
* destination "build/codenarc.html"
* }
* }
* }
* </pre>
*
* @param closure The configuration
* @return The reports container
*/
public CheckstyleReports reports(@DelegatesTo(value=CheckstyleReports.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
return reports(new ClosureBackedAction<CheckstyleReports>(closure));
}
示例6: lib
/**
* Adds dependency libraries to include in the 'lib' directory of the EAR archive.
*
* <p>The given closure is executed to configure a {@code CopySpec}. The {@link CopySpec} is passed to the closure as its delegate.</p>
*
* @param configureClosure The closure.
* @return The created {@code CopySpec}
*/
public CopySpec lib(@DelegatesTo(value = CopySpec.class, strategy = Closure.DELEGATE_FIRST) Closure configureClosure) {
return ConfigureUtil.configure(configureClosure, getLib());
}
示例7: eachFile
/**
* Adds an action to be applied to each file as it about to be copied into its destination. The given closure is
* called with a {@link org.gradle.api.file.FileCopyDetails} as its parameter. Actions are executed in the order
* added, and are inherited from the parent spec.
*
* @param closure The action to execute.
* @return this
*/
CopyProcessingSpec eachFile(@DelegatesTo(value=FileCopyDetails.class, strategy = Closure.DELEGATE_FIRST) Closure closure);