ch.epfl.lsr.apex
Class APEXMessageParser

java.lang.Object
  extended bych.epfl.lsr.apex.APEXMessageParser

class APEXMessageParser
extends Object

The APEXMessageParser parses a message according the Application Exchange (APEX) Protocol RFC3340 DTD. It returns an APEXMessage which may be:

Author:
Marc Stoecklin
See Also:
APEXAttachMessage, APEXBindMessage, APEXTerminateMessage, APEXDataMessage, APEXDataMessage.getContentType()

Constructor Summary
(package private) APEXMessageParser()
           
 
Method Summary
static APEXMessage parseMessage(Document doc)
           Extracts and returnes a parsed APEXMessage or throws an appropriate Exception on failure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

APEXMessageParser

APEXMessageParser()
Method Detail

parseMessage

public static APEXMessage parseMessage(Document doc)
                                throws APEXParsingException,
                                       NumberFormatException

Extracts and returnes a parsed APEXMessage or throws an appropriate Exception on failure.

This method splits up the four different operation types (attach, bind, terminate, or data).

Parameters:
doc - A DocumentBuilder parsed document
Returns:
The APEX Message
Throws:
APEXParsingException - Thrown on parsing errors (invalid format)
NumberFormatException - On integer parsing errors (e.g. transIDs, priorities)