backend.domainObjects
Class Message

java.lang.Object
  extended by backend.domainObjects.Message

public class Message
extends java.lang.Object

This class corresponds to the <message> tag in XML code. It contains a few fields pertaining to a message: the parent of the message, the message's ID, the poster, subject, and body of the mesage, as well as the ID of the board the message is on. It has no child-objects in this huge has-a tree... NOTE: If an ID is -1, then there was no ID written down for that message. That's not right!

Author:
ptm2

Constructor Summary
Message()
           
 
Method Summary
 void fromXML(org.kxml2.io.KXmlParser theParser)
          This method, like most other fromXML methods in the domainObjects package, assumes that the KXmlParser you give it has just found a <message> tag.
 java.lang.String getBody()
          returns the body of the message
 java.lang.Integer getID()
          returns the ID
 java.lang.Integer getParent()
          returns the parent message's ID
 java.lang.String getPoster()
          returns the poster
 java.lang.String getTitle()
          returns the subject
 java.lang.String toString()
          returns the fields of the message formatted nicely.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Method Detail

fromXML

public void fromXML(org.kxml2.io.KXmlParser theParser)
This method, like most other fromXML methods in the domainObjects package, assumes that the KXmlParser you give it has just found a <message> tag. It keeps asking the parser for elements of the XML, hoping to find tags corresponding to the fields of this class. If it finds the tags, it will set its fields to what the KXmlParser returns for its nextText() method. If, however, the nextText method returns an empty string, the fields are set to "-1", signifying that there is nothing entered for this particular field. As that should never happen, seeing "-1" should let us know that there is a mondo problem with the XML.


getID

public java.lang.Integer getID()
returns the ID


getParent

public java.lang.Integer getParent()
returns the parent message's ID


getTitle

public java.lang.String getTitle()
returns the subject


getPoster

public java.lang.String getPoster()
returns the poster


getBody

public java.lang.String getBody()
returns the body of the message


toString

public java.lang.String toString()
returns the fields of the message formatted nicely.

Overrides:
toString in class java.lang.Object