|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--VASSAL.build.module.BasicCommandEncoder
A CommandEncoder that handles the basic commands: AddPiece, RemovePiece, ChangePiece. If a module
defines custom GamePiece classes, then this class may be
overriden and imported into the module. Subclasses should override the
createDecorator(java.lang.String, VASSAL.counters.GamePiece) method or, less often, the createBasic(java.lang.String) or createPiece(java.lang.String) methods to allow instantiation
of the custom GamePiece classes.
| Constructor Summary | |
BasicCommandEncoder()
|
|
| Method Summary | |
void |
add(Buildable b)
Adds a child component. |
void |
addTo(Buildable parent)
Adds this component to its parent. |
void |
build(org.w3c.dom.Element e)
Build the object |
protected GamePiece |
createBasic(java.lang.String type)
Create a GamePiece instance that is not a Decorator @param type the type of the GamePiece. |
protected Decorator |
createDecorator(java.lang.String type,
GamePiece inner)
Creates a Decorator instance @param type the
type of the Decorator to be created. |
protected GamePiece |
createPiece(java.lang.String type)
Creates a GamePiece instance from the given type information. |
Command |
decode(java.lang.String command)
Translate a String into a Command |
java.lang.String |
encode(Command c)
Translate a Command into a String |
org.w3c.dom.Element |
getBuildElement(org.w3c.dom.Document doc)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BasicCommandEncoder()
| Method Detail |
protected Decorator createDecorator(java.lang.String type,
GamePiece inner)
Decorator instance @param type the
type of the Decorator to be created. Once created, the
Decorator should return this value from its method. @param inner the inner
piece of the Decorator @see Decorator
protected GamePiece createBasic(java.lang.String type)
GamePiece.getType()
method
protected GamePiece createPiece(java.lang.String type)
Decorator or not and
forwards to createDecorator(java.lang.String, VASSAL.counters.GamePiece) or createBasic(java.lang.String). This method should generally not need to be
overridden. Instead, override createDecorator or
createBasic
public void build(org.w3c.dom.Element e)
Buildable
build in interface Buildablee - the XML element containing the object datapublic void addTo(Buildable parent)
Buildable
addTo in interface Buildablepublic void add(Buildable b)
BuildableBuildable.addTo(VASSAL.build.Buildable) are
invoked when adding a child to a parent
add in interface Buildablepublic org.w3c.dom.Element getBuildElement(org.w3c.dom.Document doc)
getBuildElement in interface Buildablepublic Command decode(java.lang.String command)
CommandEncoderCommand
decode in interface CommandEncoderpublic java.lang.String encode(Command c)
CommandEncoderCommand into a String
encode in interface CommandEncoder
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||