javaposse.jobdsl.dsl.WithXmlAction.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of job-dsl-core Show documentation
Show all versions of job-dsl-core Show documentation
Javaposse jenkins job-dsl-core
package javaposse.jobdsl.dsl
import com.google.common.base.Preconditions
import java.util.logging.Logger
class WithXmlAction {
private static final Logger LOGGER = Logger.getLogger(WithXmlAction.getName())
private Closure closure
WithXmlAction(Closure closure) {
this.closure = Preconditions.checkNotNull(closure, "Closure has to be set during constructor")
}
def execute(Node root) {
Preconditions.checkNotNull(root)
closure.delegate = new MissingPropertyToStringDelegate(root)
// Let creator set strategy
//closure.resolveStrategy = Closure.OWNER_FIRST
use(NodeEnhancement) {
closure.call(root)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy