|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.xml.HexEncoder
public class HexEncoder
Objects of this class can encode a Hex object as XML into an
output writer and decode one from a parsed XML node. It is used when saving
games into a version- neutral format.
| Constructor Summary | |
|---|---|
HexEncoder()
|
|
| Method Summary | |
|---|---|
static IHex |
decode(gd.xml.tiny.ParsedXML node,
IGame game)
Decode a Hex object from the passed node. |
static void |
encode(IHex hex,
java.io.Writer out)
Encode a Hex object to an output writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HexEncoder()
| Method Detail |
|---|
public static void encode(IHex hex,
java.io.Writer out)
throws java.io.IOException
Hex object to an output writer.
hex - - the Hex to be encoded. This value must not be
null.out - - the Writer that will receive the XML. This
value must not be null.
IllegalArgumentException - if the node is
null.
IOException - if there's any error on write.
java.io.IOException
public static IHex decode(gd.xml.tiny.ParsedXML node,
IGame game)
Hex object from the passed node.
node - - the ParsedXML node for this object. This
value must not be null.game - - the IGame the decoded object belongs to.
Hex object based on the node.
IllegalArgumentException - if the node is
null.
IllegalStateException - if the node does not contain
a valid Hex.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||