|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StackAction
An interface that can be implemented in order to get notifications of objects being pushed onto a digester stack or popped from one.
Because objects are pushed onto the main object stack when a rule has created a new object, this gives the ability to intercept such operations and perform modifications on created objects.
One use expected for this interface is to store information about the xml line that a particular object was created from. An implementation of this interface can detect whenever an object is pushed onto the digester object stack, call Digester.getDocumentLocator() to get the location within the current xml file, and store this either on the object on the stack (if it supports some user-specific interface for this purpose), or build a map of (object->locationinfo) separately.
It is recommended that objects implementing this interface provide a method to set a "next" action, and invoke it from the callback methods. This allows multiple actions to be "chained" together.
See also Digester.setStackAction.
Method Summary | ||
---|---|---|
|
onPop(Digester d,
String stackName,
T o)
Invoked just after an object has been popped from a digester stack. |
|
|
onPush(Digester d,
String stackName,
T o)
Invoked just before an object is to be pushed onto a digester stack. |
Method Detail |
---|
<T> T onPush(Digester d, String stackName, T o)
T
- whatever type is acceptedd
- is the digester instance.stackName
- is the name of the stack onto which the object has been pushed. Null is passed to indicate the
default stack.o
- is the object that has just been pushed. Calling peek on the specified stack will return
the same object.
<T> T onPop(Digester d, String stackName, T o)
T
- whatever type is acceptedd
- is the digester instance.stackName
- is the name of the stack from which the object has been popped. Null is passed to indicate the
default stack.o
- is the object that has just been popped.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |