de.infoasset.platform.template
Class ListSubstitution

java.lang.Object
  extended by de.infoasset.platform.template.ListSubstitution
All Implemented Interfaces:
Substitution, Testable
Direct Known Subclasses:
ConsistencyListSubstitution, SimpleStringListSubstitution

public abstract class ListSubstitution
extends java.lang.Object
implements Substitution, Testable

A ListTemplate is both a Template and a Substitution that is able to print itself as a list onto an output stream.

See Also:
TemplateDoc

Field Summary
static java.lang.reflect.Method GET_CURRENT_ASSET
           
 
Constructor Summary
ListSubstitution()
           
 
Method Summary
 void end()
           
 Asset getCurrentAsset()
           
abstract  boolean hasNext()
          Returns true, if there is at least one further list element.
 void initAll(Template template)
           
abstract  void next()
          Advances to the next list element.
 void putSubstitutions(Template template)
          Initializes the list template.
abstract  void start()
          Starts one iteration over the list.
 boolean test()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET_CURRENT_ASSET

public static java.lang.reflect.Method GET_CURRENT_ASSET
Constructor Detail

ListSubstitution

public ListSubstitution()
Method Detail

initAll

public void initAll(Template template)

putSubstitutions

public void putSubstitutions(Template template)
Initializes the list template. This operation is called by the constructor and permits subclasses to do custom initialisations by overriding init. The main purpose of init is to instantiate and add further substitutions, since substitutions must be added prior to the first instation of the template.


start

public abstract void start()
Starts one iteration over the list. May be called several times, if the containing template has more than one element with this list template. This implementation just calls the parameter-less start() operation and can be overwritten by subclasses needing the session.


hasNext

public abstract boolean hasNext()
Returns true, if there is at least one further list element. This operations must not have side effects; it may be called several times before next next(). The first call to hasNext() deceides if a list is empty. If so, next() will never be called. Subclasses must implement this operation.


next

public abstract void next()
Advances to the next list element. This operation is guaranteed to be called exactly once before the calls to all aggregated list element substitutions. next() is also called before the first element. If the very first hasNext() returns false, next will never be called. Subclasses must implement this operation.


getCurrentAsset

public Asset getCurrentAsset()

end

public void end()

test

public final boolean test()
Specified by:
test in interface Testable