當前位置: 首頁>>代碼示例>>Java>>正文


Java Closure.DELEGATE_FIRST屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:16,代碼來源:Ear.java

示例2: ClosureBackedAction

public ClosureBackedAction(Closure closure) {
    this(closure, Closure.DELEGATE_FIRST, true);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:3,代碼來源:ClosureBackedAction.java

示例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));
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:6,代碼來源:Pmd.java

示例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);
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:16,代碼來源:Reporting.java

示例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));
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:21,代碼來源:Checkstyle.java

示例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());
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:11,代碼來源:Ear.java

示例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);
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:9,代碼來源:CopyProcessingSpec.java


注:本文中的groovy.lang.Closure.DELEGATE_FIRST屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。