de.dante.extex.interpreter.context
Interface ContextGroup

All Known Subinterfaces:
Context, ContextInternals
All Known Implementing Classes:
ContextExtensionImpl, ContextImpl

public interface ContextGroup

This interface describes the container for group-related of an interpreter context.

Version:
$Revision: 1.11 $
Author:
Gerd Neugebauer

Method Summary
 void afterGroup(AfterGroupObserver observer)
          Register a observer to be called at the end of the group.
 void afterGroup(Token t)
          Add a token to the tokens inserted after the group has been closed.
 void closeGroup(Typesetter typesetter, TokenSource source)
          Perform all actions required upon the closing of a group.
 GroupInfo[] getGroupInfos()
          Getter for the array of group information describing the currently open groups.
 long getGroupLevel()
          Getter for the group level.
 GroupType getGroupType()
          Getter for the group type.
 boolean isGlobalGroup()
          Test whether this group is the first one, which means that there is no group before and closing this group would fail.
 void openGroup(GroupType id, Locator locator, Token start)
          This method can be used to open another group.
 

Method Detail

afterGroup

public void afterGroup(AfterGroupObserver observer)
Register a observer to be called at the end of the group. The end of the group is reached when the group is closed.

Parameters:
observer - the observer to register
See Also:
closeGroup(Typesetter, TokenSource)

afterGroup

public void afterGroup(Token t)
                throws InterpreterException
Add a token to the tokens inserted after the group has been closed.

Parameters:
t - the token to add
Throws:
InterpreterException - in case of an error
See Also:
closeGroup(Typesetter, TokenSource)

closeGroup

public void closeGroup(Typesetter typesetter,
                       TokenSource source)
                throws InterpreterException
Perform all actions required upon the closing of a group.

Parameters:
typesetter - the typesetter to invoke if needed
source - the source to get Tokens from if needed
Throws:
InterpreterException - in case of an error
See Also:
openGroup(GroupType, Locator, Token)

getGroupInfos

public GroupInfo[] getGroupInfos()
Getter for the array of group information describing the currently open groups. The elements represent the groups in ascending order. Thus the element 0 always represents the global group. This one is guaranteed to be present. This means that the arras has always at least one element.

Returns:
the array of group infos
See Also:
getGroupLevel()

getGroupLevel

public long getGroupLevel()
Getter for the group level. The group level is the number of groups which are currently open. Thus this number of groups can be closed.

Returns:
the group level
See Also:
getGroupInfos()

getGroupType

public GroupType getGroupType()
Getter for the group type.

Returns:
the group type
See Also:
openGroup(GroupType, Locator, Token)

isGlobalGroup

public boolean isGlobalGroup()
Test whether this group is the first one, which means that there is no group before and closing this group would fail.

Returns:
true iff this is the first group
See Also:
openGroup(GroupType, Locator, Token)

openGroup

public void openGroup(GroupType id,
                      Locator locator,
                      Token start)
               throws ConfigurationException,
                      InterpreterException
This method can be used to open another group. The current group is pushed onto the stack to be reactivated when the new group will be closed.

Parameters:
id - the type of the group
locator - the locator for the start
start - the token which started the group
Throws:
ConfigurationException - in case of an error in the configuration, e.g. the class for the group can not be determined.
InterpreterException - in case of an error
See Also:
closeGroup(Typesetter, TokenSource)