public class ChainedClosure extends Object implements Closure, Serializable
Constructor and Description |
---|
ChainedClosure(Closure[] closures)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(Object input)
Execute a list of closures.
|
Closure[] |
getClosures()
Gets the closures, do not modify the array.
|
static Closure |
getInstance(Closure[] closures)
Factory method that performs validation and copies the parameter array.
|
static Closure |
getInstance(Closure closure1,
Closure closure2)
Factory method that performs validation.
|
static Closure |
getInstance(Collection closures)
Create a new Closure that calls each closure in turn, passing the
result into the next closure.
|
public ChainedClosure(Closure[] closures)
getInstance
if you want that.closures
- the closures to chain, not copied, no nullspublic static Closure getInstance(Closure[] closures)
closures
- the closures to chain, copied, no nullschained
closureIllegalArgumentException
- if the closures array is nullIllegalArgumentException
- if any closure in the array is nullpublic static Closure getInstance(Collection closures)
closures
- a collection of closures to chainchained
closureIllegalArgumentException
- if the closures collection is nullIllegalArgumentException
- if any closure in the collection is nullpublic static Closure getInstance(Closure closure1, Closure closure2)
closure1
- the first closure, not nullclosure2
- the second closure, not nullchained
closureIllegalArgumentException
- if either closure is nullpublic void execute(Object input)
public Closure[] getClosures()
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.