|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.rules.closure.support.AbstractElementGenerator
public abstract class AbstractElementGenerator
Base superclass for process templates.
Constructor Summary | |
---|---|
protected |
AbstractElementGenerator()
Default constructor. |
protected |
AbstractElementGenerator(boolean runOnce)
Constructor. |
Method Summary | |
---|---|
boolean |
allTrue(Constraint constraint)
Does this process produce all elements matching the given criteria? |
boolean |
anyTrue(Constraint constraint)
Does this process produce an element matching the given criteria? |
ElementGenerator |
findAll(Constraint constraint)
Find all elements produced by ths template that match the specified criteria. |
Object |
findFirst(Constraint constraint)
Find the first element that matches the given criteria. |
Object |
findFirst(Constraint constraint,
Object defaultIfNoneFound)
Find the first element that matches the given criteria, return defaultIfNoneFound if none found. |
protected ElementGenerator |
getWrappedTemplate()
|
boolean |
isFinished()
|
boolean |
isRunning()
|
boolean |
isStopped()
|
protected void |
reset()
Reset the ElementGenerator if possible. |
abstract void |
run(Closure templateCallback)
Execute the template with the specific closure callback for the insertion of custom processing code. |
void |
runUntil(Closure templateCallback,
Constraint constraint)
Run a block of code (Closure) until a specific test (Constraint) is passed. |
protected void |
setCompleted()
Set status completed. |
protected void |
setRunning()
Set status running. |
void |
stop()
Stop the generator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractElementGenerator()
protected AbstractElementGenerator(boolean runOnce)
runOnce
- true
if this ElementGenerator may only be
run once (will throw an Exception if called more than once).Method Detail |
---|
protected ElementGenerator getWrappedTemplate()
null
.public boolean allTrue(Constraint constraint)
allTrue
in interface ElementGenerator
constraint
- the criteria
true
if yes, false
otherwisepublic boolean anyTrue(Constraint constraint)
anyTrue
in interface ElementGenerator
constraint
- the criteria
true
if yes, false
otherwisepublic ElementGenerator findAll(Constraint constraint)
findAll
in interface ElementGenerator
constraint
- the criteria
public Object findFirst(Constraint constraint)
findFirst
in interface ElementGenerator
constraint
- the criteria
public Object findFirst(Constraint constraint, Object defaultIfNoneFound)
defaultIfNoneFound
if none found.
findFirst
in interface ElementGenerator
constraint
- the constraintdefaultIfNoneFound
- none found object
public boolean isStopped()
true
if the generator is stopped.public boolean isFinished()
true
if the generator has completed it's task.public boolean isRunning()
true
if the generator is still running.public void stop() throws IllegalStateException
stop
in interface ElementGenerator
IllegalStateException
public void runUntil(Closure templateCallback, Constraint constraint)
runUntil
in interface ElementGenerator
templateCallback
- the callbackconstraint
- the constraint conditionprotected void reset()
UnsupportedOperationException
- if this ElementGenerator was a
runOnce instance.protected void setRunning()
protected void setCompleted()
public abstract void run(Closure templateCallback)
run
in interface ClosureTemplate
templateCallback
- The procedure callback.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |