|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.media.tile.tools.xml.XMLTileSetParser
public class XMLTileSetParser
Parse an XML tileset description file and construct tileset objects for each valid description. Does not currently perform validation on the input XML stream, though the parsing code assumes the XML document is well-formed.
| Constructor Summary | |
|---|---|
XMLTileSetParser()
Constructs an xml tile set parser. |
|
| Method Summary | |
|---|---|
void |
addRuleSet(String prefix,
TileSetRuleSet ruleset)
Adds a ruleset to be used when parsing tiles. |
void |
loadTileSets(File file,
Map<String,TileSet> tilesets)
Loads all of the tilesets specified in the supplied XML tileset description file and places them into the supplied map indexed by tileset name. |
void |
loadTileSets(InputStream source,
Map<String,TileSet> tilesets)
Loads all of the tilesets specified in the supplied XML tileset description file and places them into the supplied map indexed by tileset name. |
void |
loadTileSets(String path,
Map<String,TileSet> tilesets)
Loads all of the tilesets specified in the supplied XML tileset description file and places them into the supplied map indexed by tileset name. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLTileSetParser()
| Method Detail |
|---|
public void addRuleSet(String prefix,
TileSetRuleSet ruleset)
TileSetRuleSet. The prefix
will be used to configure the ruleset so that it matches elements
at a particular point in the XML hierarchy. For example:
_parser.addRuleSet("tilesets", new UniformTileSetRuleSet());
public void loadTileSets(String path,
Map<String,TileSet> tilesets)
throws IOException
path - a path, relative to the classpath, at which the tileset
definition file can be found.tilesets - the map into which the tilesets will be placed,
indexed by tileset name.
IOException
public void loadTileSets(File file,
Map<String,TileSet> tilesets)
throws IOException
file - the file in which the tileset definition file can be
found.tilesets - the map into which the tilesets will be placed,
indexed by tileset name.
IOException
public void loadTileSets(InputStream source,
Map<String,TileSet> tilesets)
throws IOException
source - an input stream from which the tileset definition
file can be read.tilesets - the map into which the tilesets will be placed,
indexed by tileset name.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||