public class ConfigureUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ConfigureUtil.IncompleteInputException |
| Constructor and Description |
|---|
ConfigureUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
configure(Closure configureClosure,
T delegate)
|
static <T> T |
configure(Closure configureClosure,
T delegate,
boolean configureableAware)
|
static <T> T |
configure(Closure configureClosure,
T delegate,
int resolveStrategy)
|
static <T> T |
configureByMap(Map<String,?> properties,
T delegate) |
static <T> T |
configureByMap(Map<String,?> properties,
T delegate,
Collection<String> mandatoryKeys) |
public static <T> T configureByMap(Map<String,?> properties, T delegate, Collection<String> mandatoryKeys)
public static <T> T configure(Closure configureClosure, T delegate)
Configures delegate with configureClosure, via the Configurable interface if necessary.
If delegate does not implement Configurable interface, it is set as the delegate of a clone of
configureClosure with a resolve strategy of DELEGATE_FIRST.
If delegate does implement the Configurable interface, the configureClosure will be passed to
delegate's Configurable.configure(Closure) method.
configureClosure - The configuration closuredelegate - The object to be configuredpublic static <T> T configure(Closure configureClosure, T delegate, boolean configureableAware)
Configures delegate with configureClosure, via the Configurable interface if necessary.
If delegate does not implement Configurable interface, it is set as the delegate of a clone of
configureClosure with a resolve strategy of DELEGATE_FIRST.
If delegate does implement the Configurable interface, the configureClosure will be passed to
delegate's Configurable.configure(Closure) method. However, if configureableAware is false then
delegate will be treated like it does not implement the configurable interface.
configureClosure - The configuration closuredelegate - The object to be configuredconfigureableAware - Whether or not to use the Configurable interface to configure the object if possiblepublic static <T> T configure(Closure configureClosure, T delegate, int resolveStrategy)
Configures delegate with configureClosure, ignoring the Configurable interface.
delegate is set as the delegate of a clone of configureClosure with a resolve strategy
of the resolveStrategy param.
configureClosure - The configuration closuredelegate - The object to be configuredresolveStrategy - The resolution strategy to use for the configuration closureCopyright © 2013. All rights reserved