|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
es.ucm.fdi.hysteria.game.parser.XMLParser
public class XMLParser
Field Summary | |
---|---|
protected java.lang.String |
_actualId
|
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.String>> |
_allExits
|
protected java.util.Hashtable<java.lang.String,Item> |
_allItems
|
protected java.util.Hashtable<java.lang.String,Location> |
_allLocs
|
protected java.util.Hashtable<java.lang.String,Obstacle> |
_allObstacles
|
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>>> |
_allReactionsDisables
|
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>>> |
_allReactionsEnables
|
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.String>> |
_allReactionsExtinguish
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_allReactionsItems
|
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.String>> |
_allReactionsMessages
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_allRelated
|
protected java.util.Hashtable<java.lang.String,Scene> |
_allScenes
|
protected java.util.Hashtable<java.lang.String,Topic> |
_allTopics
|
protected int |
_amount
|
protected boolean |
_atLeastOne
|
protected java.lang.String |
_author
|
protected java.lang.String |
_auxDesc
|
protected java.lang.String |
_auxName
|
protected boolean |
_bconnection
|
protected boolean |
_bdescription
|
protected boolean |
_bego
|
protected boolean |
_bexitmessage
|
protected boolean |
_bgame
|
protected boolean |
_bitem
|
protected boolean |
_blocation
|
protected boolean |
_blocinfo
|
protected boolean |
_bmusic
|
protected boolean |
_bobstacle
|
protected boolean |
_breaction
|
protected boolean |
_bscene
|
protected boolean |
_bthreshold
|
protected boolean |
_btopic
|
protected java.util.LinkedList<java.lang.Boolean> |
_bused
|
protected java.util.LinkedList<java.lang.Boolean> |
_busedWith
|
protected Location |
_currentLocation
|
protected Scene |
_currentScene
|
protected Topic |
_currentTopic
|
protected java.lang.String |
_desc
|
protected java.lang.String |
_exitMessage
|
protected java.util.LinkedList<java.lang.Boolean> |
_extinguishWhenUsed
|
protected java.util.LinkedList<java.lang.Boolean> |
_extinguishWhenUsedWith
|
protected java.lang.String |
_gamePath
|
protected java.lang.String |
_id
|
protected java.lang.String |
_image
|
protected java.io.InputStream |
_in
|
protected java.lang.String |
_initialId
|
protected ItemRepository |
_initialInventory
|
protected Location |
_initialLocation
|
protected java.lang.String |
_intro
|
protected java.util.LinkedList<java.lang.String> |
_itemIdQueue
|
protected java.util.LinkedList<java.lang.String> |
_itemIdUseWithQueue
|
protected java.util.LinkedList<Item> |
_itemQueue
|
protected java.util.LinkedList<UsedWithInfo> |
_itemUses
|
protected Game.Direction |
_lastDir
|
protected int |
_lightLevel
|
protected boolean |
_lightsOn
|
protected java.util.Hashtable<java.lang.String,java.lang.String> |
_locationItemRel
|
protected java.lang.String |
_name
|
protected boolean |
_obstacleActive
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_obstacleItemRel
|
protected boolean |
_parsed
|
protected java.lang.String |
_reactionExtinguish
|
protected java.lang.String |
_reactionId
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_relativeScenesDisable
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_relativeScenesEnable
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_relativeTopicsDisable
|
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
_relativeTopicsEnable
|
protected boolean |
_sceneActive
|
protected java.lang.String |
_sceneId
|
protected java.lang.String |
_sceneImage
|
protected java.lang.String |
_target
|
protected int |
_threshold
|
protected java.lang.String |
_title
|
protected boolean |
_topicActive
|
protected boolean |
_topicIsFinal
|
protected int |
_totalLocations
|
protected boolean |
_unassignedInitialLocation
|
protected int |
_value
|
protected float |
_weight
|
protected java.lang.StringBuffer |
buffer
|
protected java.lang.String |
desc
|
protected java.lang.String |
exit
|
protected java.lang.String |
id
|
protected java.lang.String |
name
|
protected java.io.StreamTokenizer |
st
|
protected java.lang.String |
topicId
|
Constructor Summary | |
---|---|
XMLParser(java.lang.String path)
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName)
|
java.lang.String |
getAuthor()
Returns the game author |
java.lang.String |
getDesc()
Returns the game description |
ItemRepository |
getInitialInventory()
Returns the initial inventory |
Location |
getInitialLocation()
Returns the initial location |
java.lang.String |
getTitle()
Returns the game title |
int |
getTotalLocations()
|
void |
parse(java.io.InputStream in)
Asks for a SAXParser, and parses the file denoted by the input stream |
boolean |
parsed()
Was the game successfully parsed? |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes atrs)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean _bego
protected boolean _bgame
protected boolean _blocation
protected boolean _bitem
protected boolean _bobstacle
protected boolean _bconnection
protected boolean _bdescription
protected boolean _bmusic
protected boolean _blocinfo
protected boolean _bthreshold
protected boolean _bexitmessage
protected boolean _bscene
protected boolean _btopic
protected boolean _breaction
protected boolean _parsed
protected java.lang.String id
protected java.lang.String name
protected java.lang.String desc
protected java.lang.String exit
protected java.lang.String _sceneId
protected java.lang.String topicId
protected java.lang.String _sceneImage
protected java.lang.String _reactionExtinguish
protected java.lang.StringBuffer buffer
protected java.io.InputStream _in
protected Game.Direction _lastDir
protected boolean _unassignedInitialLocation
protected boolean _atLeastOne
protected boolean _obstacleActive
protected boolean _sceneActive
protected boolean _topicActive
protected boolean _topicIsFinal
protected boolean _lightsOn
protected Location _initialLocation
protected Location _currentLocation
protected Scene _currentScene
protected Topic _currentTopic
protected java.lang.String _initialId
protected java.lang.String _actualId
protected java.lang.String _name
protected java.lang.String _author
protected java.lang.String _desc
protected java.lang.String _id
protected java.lang.String _target
protected java.lang.String _image
protected java.lang.String _intro
protected java.lang.String _auxName
protected java.lang.String _auxDesc
protected java.lang.String _exitMessage
protected java.lang.String _title
protected java.lang.String _reactionId
protected int _value
protected int _threshold
protected int _amount
protected int _totalLocations
protected int _lightLevel
protected float _weight
protected java.util.Hashtable<java.lang.String,Location> _allLocs
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.String>> _allExits
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.String>> _allReactionsMessages
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.String>> _allReactionsExtinguish
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>>> _allReactionsEnables
protected java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>>> _allReactionsDisables
protected java.util.Hashtable<java.lang.String,Obstacle> _allObstacles
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _obstacleItemRel
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _allRelated
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _relativeTopicsEnable
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _relativeScenesEnable
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _relativeTopicsDisable
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _relativeScenesDisable
protected java.util.Hashtable<java.lang.String,java.util.LinkedHashSet<java.lang.String>> _allReactionsItems
protected java.util.Hashtable<java.lang.String,Item> _allItems
protected java.util.Hashtable<java.lang.String,java.lang.String> _locationItemRel
protected java.util.Hashtable<java.lang.String,Scene> _allScenes
protected java.util.Hashtable<java.lang.String,Topic> _allTopics
protected java.util.LinkedList<Item> _itemQueue
protected java.util.LinkedList<java.lang.String> _itemIdQueue
protected java.util.LinkedList<java.lang.String> _itemIdUseWithQueue
protected java.util.LinkedList<java.lang.Boolean> _extinguishWhenUsed
protected java.util.LinkedList<java.lang.Boolean> _extinguishWhenUsedWith
protected java.util.LinkedList<java.lang.Boolean> _bused
protected java.util.LinkedList<java.lang.Boolean> _busedWith
protected java.util.LinkedList<UsedWithInfo> _itemUses
protected ItemRepository _initialInventory
protected java.io.StreamTokenizer st
protected java.lang.String _gamePath
Constructor Detail |
---|
public XMLParser(java.lang.String path)
Method Detail |
---|
public boolean parsed()
public void parse(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException
in
- The input stream
java.io.IOException
org.xml.sax.SAXException
public Location getInitialLocation() throws UnparsedGameDefinitionException, InvalidGameDefinitionException
UnparsedGameDefinitionException
InvalidGameDefinitionException
public ItemRepository getInitialInventory() throws UnparsedGameDefinitionException, InvalidGameDefinitionException
UnparsedGameDefinitionException
InvalidGameDefinitionException
public java.lang.String getTitle() throws UnparsedGameDefinitionException, InvalidGameDefinitionException
UnparsedGameDefinitionException
InvalidGameDefinitionException
public java.lang.String getAuthor() throws UnparsedGameDefinitionException, InvalidGameDefinitionException
UnparsedGameDefinitionException
InvalidGameDefinitionException
public java.lang.String getDesc() throws UnparsedGameDefinitionException, InvalidGameDefinitionException
UnparsedGameDefinitionException
InvalidGameDefinitionException
public int getTotalLocations() throws UnparsedGameDefinitionException
UnparsedGameDefinitionException
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes atrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |