GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse.toolkit
Interface EntityStack<T extends Parser>

All Known Implementing Classes:
CoroutineEntityStack

public interface EntityStack<T extends Parser>

Stack of the entities that are currently being processed. Entities can be nested in elements or other entities. The entity at the top of stack is the only active entity. Lower entities become active again when all of the entities above them have been popped. Re-activating an entity causes processing to continue from the point where processing was previous suspended to allow processing of another entity or an element.


Method Summary
 Entity getCurrentEntity()
           Get the CurrentEntity at the top of the stack without removing it from the stack.
 boolean isEmpty()
           Indicate whether entity stack is empty.
 Entity pop()
           Remove the current entity from the top of the stack.
 void push(CoroutineEntity<T> coroutineEntity)
           Push a new CoroutineEntity on the entity stack, where it will become the current entity.
 

Method Detail

push

void push(CoroutineEntity<T> coroutineEntity)

Push a new CoroutineEntity on the entity stack, where it will become the current entity.

Throws:
NullPointerException - if CoroutineEntity is null

pop

Entity pop()

Remove the current entity from the top of the stack. The entity is no longer valid as an instance of CurrentEntity. The entity is normally popped when it goes out of scope in the document, in which case it will not be valid even as an instance of the superclass Entity.

Returns:
the entity removed from the entity stack
Throws:
EmptyStackException - if the entity stack is empty

isEmpty

boolean isEmpty()

Indicate whether entity stack is empty.

Returns:
true if there are no entities on the entity stack

getCurrentEntity

Entity getCurrentEntity()

Get the CurrentEntity at the top of the stack without removing it from the stack.

Throws:
EmptyStackException - if the entity stack is empty

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License