|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.knipp.rritoolkit.message.Message
public abstract class Message
base class for all messages
Nested Class Summary | |
---|---|
static class |
Message.Type
enumeration for the different message types |
Field Summary | |
---|---|
private java.util.Date |
created
the point in time the message was generated |
private static java.util.Map<java.lang.String,Message.Type> |
elementToTypeMap
map from the XML element's local name to the type |
private java.lang.String |
messageID
the message ID |
private Message.Type |
type
the type of the message |
Constructor Summary | |
---|---|
Message()
|
Method Summary | |
---|---|
abstract void |
accept(MessageVisitor visitor)
calls the suitable method of the given visitor |
protected static Message |
createMessage(Message.Type type)
factory for the various message types |
protected abstract void |
dataFromList(KVList list)
setups the object's data from the given list. |
protected abstract void |
dataFromXml(org.w3c.dom.Element el)
setup the object's data from the given XML element. |
static Message |
fromList(KVList list)
initializes the instance from the given key-value multi-list |
static Message |
fromXml(org.w3c.dom.Element el)
create an instance from the given XML element |
java.util.Date |
getCreationDate()
returns the point in time at which the message was generated |
java.lang.String |
getMessageID()
returns the message ID |
Message.Type |
getType()
returns the type of the message |
protected void |
setData(java.lang.String theID,
Message.Type theType,
java.util.Date theCreationDate)
set the member variables of this base class |
java.lang.String |
toString()
returns a string representation for debugging purposes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String messageID
private Message.Type type
private java.util.Date created
private static final java.util.Map<java.lang.String,Message.Type> elementToTypeMap
Constructor Detail |
---|
public Message()
Method Detail |
---|
protected void setData(java.lang.String theID, Message.Type theType, java.util.Date theCreationDate)
theID
- the message IDtheType
- the typetheCreationDate
- the dateprotected static Message createMessage(Message.Type type)
type
- the type, may be null
(which behaves as an unknown type)
java.lang.IllegalArgumentException
- if the given type is unknown
or unsupportedpublic static Message fromXml(org.w3c.dom.Element el) throws org.w3c.dom.DOMException, ResponseParseException
el
- the element
org.w3c.dom.DOMException
- on DOM exceptions
ResponseParseException
- if the data was not recognisedprotected abstract void dataFromXml(org.w3c.dom.Element el) throws org.w3c.dom.DOMException, ResponseParseException
el
- the element
org.w3c.dom.DOMException
- on DOM exceptions
ResponseParseException
- if the data was not recognisedpublic static Message fromList(KVList list) throws ResponseParseException
list
- the list
ResponseParseException
- if the list does not contain the
expected contentprotected abstract void dataFromList(KVList list) throws ResponseParseException
list
- the list
ResponseParseException
- if the list does not contain the
expected contentpublic java.lang.String getMessageID()
public Message.Type getType()
public java.util.Date getCreationDate()
public abstract void accept(MessageVisitor visitor)
visitor
- the visitorpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |