net.sf.freecol.client.control
Class PreGameInputHandler

java.lang.Object
  extended by net.sf.freecol.client.control.InputHandler
      extended by net.sf.freecol.client.control.PreGameInputHandler
All Implemented Interfaces:
MessageHandler, StreamedMessageHandler

public final class PreGameInputHandler
extends InputHandler
implements StreamedMessageHandler

Handles the network messages that arrives before the game starts.


Constructor Summary
PreGameInputHandler(FreeColClient freeColClient)
          The constructor to use.
 
Method Summary
 boolean accepts(java.lang.String tagName)
          Checks if the message handler support the given message.
 org.w3c.dom.Element handle(Connection connection, org.w3c.dom.Element element)
          Deals with incoming messages that have just been received.
 void handle(Connection connection, javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out)
          Handles the main element of an XML message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreGameInputHandler

public PreGameInputHandler(FreeColClient freeColClient)
The constructor to use.

Parameters:
freeColClient - The main controller.
Method Detail

handle

public org.w3c.dom.Element handle(Connection connection,
                                  org.w3c.dom.Element element)
Deals with incoming messages that have just been received.

Specified by:
handle in interface MessageHandler
Specified by:
handle in class InputHandler
Parameters:
connection - The Connection the message was received on.
element - The root element of the message.
Returns:
The reply.

handle

public void handle(Connection connection,
                   javax.xml.stream.XMLStreamReader in,
                   javax.xml.stream.XMLStreamWriter out)
Handles the main element of an XML message.

Specified by:
handle in interface StreamedMessageHandler
Parameters:
connection - The connection the message came from.
in - The stream containing the message.
out - The output stream for the reply.

accepts

public boolean accepts(java.lang.String tagName)
Checks if the message handler support the given message.

Specified by:
accepts in interface StreamedMessageHandler
Parameters:
tagName - The tag name of the message to check.
Returns:
The result.