nl.flotsam.pecia.builder.base
Class OrderPreservingLifecycleListener

java.lang.Object
  extended by nl.flotsam.pecia.builder.base.OrderPreservingLifecycleListener
All Implemented Interfaces:
LifecycleListener

public class OrderPreservingLifecycleListener
extends Object
implements LifecycleListener

An implementation of the LifecycleListener interface that decorates another LifecycleListener, adding support for preserving the order of constructing elements. Withtout this class, you would basically be able to hold on to a certain document element, continue to add elements to it, and then all of a sudden also add content to the document element that you held on to.

Author:
Wilfred Springer

Constructor Summary
OrderPreservingLifecycleListener()
           
OrderPreservingLifecycleListener(LifecycleListener listener)
           
 
Method Summary
 void ended(Object documentElement)
          Invoked when a document element is popped from the stack.
 void started(Object documentElement)
          Invoked when a new document element is commited to the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderPreservingLifecycleListener

public OrderPreservingLifecycleListener(LifecycleListener listener)

OrderPreservingLifecycleListener

public OrderPreservingLifecycleListener()
Method Detail

ended

public void ended(Object documentElement)
Description copied from interface: LifecycleListener
Invoked when a document element is popped from the stack.

Specified by:
ended in interface LifecycleListener
Parameters:
documentElement - The document element popped from the stack.

started

public void started(Object documentElement)
Description copied from interface: LifecycleListener
Invoked when a new document element is commited to the stack.

Specified by:
started in interface LifecycleListener
Parameters:
documentElement - The document element pushed on the stack.


Copyright © 2010. All Rights Reserved.