com.hdcookbook.grin.commands
Class SECommandList
java.lang.Object
com.hdcookbook.grin.commands.Command
com.hdcookbook.grin.GrinXHelper
com.hdcookbook.grin.SEGrinXHelper
com.hdcookbook.grin.commands.SECommandList
- All Implemented Interfaces:
- Node, SENode
public class SECommandList
- extends SEGrinXHelper
Fields inherited from class com.hdcookbook.grin.commands.Command |
show |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
SECommandList
public SECommandList(SEShow show,
Command[] subCommands)
accept
public void accept(SEShowVisitor visitor)
- Description copied from interface:
SENode
- Calls the visit method corresponding to this node type.
If you are defining a user-defined feature, there are some
restrictions that you'll want to follow. If your extension is
a feature that has children, then you should make it a subclass
of one of the built-in feature types, Assembly, Modifer or Group.
That's because the GRIN compiler defines visitors that need to
visit every node in the tree, but these built-in visitors don't
know about your extension types. By making your extension type
a subclass of one of the standard ones, and by making your
accept()
method call either
visitAssembly()
, visitGroup()
or
visitUserDefinedModifier()
, as appropriate,
you'll ensure that all the children get visited.
- Parameters:
visitor
- SEShowVisitor object.- See Also:
SEShowVisitor
postProcess
public void postProcess(ShowBuilder builder)
throws java.io.IOException
- Do any needed post-processing in this show. The grin compiler works
as follows:
- GRIN source file is read and tree is built in memory
- Forward references are resolved (in multiple passes)
- postProcess() is called on every node. During the call,
child feature nodes can be added, and parent features can
be injected.
- The double-use checker runs to ensure the graph structure
is valid.
- Deferred builders (e.g. TranslatorHelper) are called.
Deferred builders cannot make changes to the tree structure.
During the post-process phase, a node can add new features to the
show, by calling ShowBuilder.addSyntheticFeature()
,
and it can insert a new feature as the parent of a given feature,
by calling ShowBuilder.injectParent()
. It can also
add segments and handlers by calling the appropriate builder methods.
When a parent is injected, the
ShowBuilder calls postProcess() on all nodes automatically,
including nodes that are created during the execution of postProcess()
in another node.
- Specified by:
postProcess
in interface SENode
- Overrides:
postProcess
in class SEGrinXHelper
- Parameters:
builder
- The builder that holds state for the show
- Throws:
java.io.IOException
- if an error is encountered- See Also:
ShowBuilder.addSyntheticFeature(Feature)
,
ShowBuilder.injectParent(Feature, Feature)
changeFeatureReference
public void changeFeatureReference(Feature from,
Feature to)
- Change a feature reference from one feature to a new one. If your
node has a reference to the feature
from
, it should be
changed to refer to to
. This is called for every node
in an SEShow when SENode.injectParent
is used.
The ShowBuilder calls changeFeatureReference() on all nodes
automatically, including nodes that are created during the
execution of postProcess().
- Specified by:
changeFeatureReference
in interface SENode
- Overrides:
changeFeatureReference
in class SEGrinXHelper
- See Also:
SENode.changeFeatureReference(Feature, Feature)
toString
public java.lang.String toString()
- Return a user-friendly string for this command for debugging
purposes.
- Overrides:
toString
in class GrinXHelper