|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jabber.jabberbeans.PacketBuilder | +--org.jabber.jabberbeans.MessageBuilder
This class is used to build the complex 'Message' object. After entering all the appropriate commands, you call build(), which returns a message object. Unlike most Builder Patterns, this is not used to create different types of objects. However, Message objects are meant to be immutable, and the complex creation (variable number and types of arguments) made this class much simpler.
Field Summary |
Fields inherited from class org.jabber.jabberbeans.PacketBuilder |
error, extensions, fromAddress, identifier, toAddress, type |
Constructor Summary | |
MessageBuilder()
|
Method Summary | |
Packet |
build()
Build a new Message object based on the current builder state. |
java.lang.String |
getBody()
get the message body |
java.lang.String |
getSubject()
get the subject of the message |
java.lang.String |
getThread()
get the current discussion thread this message is being created with. |
void |
reset()
Reset prepares the message builder class to build a new message. |
void |
setBody(java.lang.String body)
set the message body (the meat of the message) |
void |
setSubject(java.lang.String subject)
set the subject of the message |
void |
setThread(java.lang.String thread)
set the discussion thread that the message belongs to. |
Methods inherited from class org.jabber.jabberbeans.PacketBuilder |
addExtension, delExtension, getError, getErrorCode, getErrorText, getExtensionVector, getFromAddress, getIdentifier, getToAddress, getType, resetBase, setError, setErrorCode, setErrorText, setFromAddress, setIdentifier, setToAddress, setType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageBuilder()
Method Detail |
public void reset()
reset
in class PacketBuilder
public Packet build() throws java.lang.InstantiationException
build
in class PacketBuilder
java.lang.InstantiationException
- thrown if a valid message cannot
be constructed from the current parameters.public void setThread(java.lang.String thread)
thread
- a value of type 'String'public java.lang.String getThread()
public void setSubject(java.lang.String subject)
subject
- a value of type 'String'public java.lang.String getSubject()
public void setBody(java.lang.String body)
body
- a value of type 'String'public java.lang.String getBody()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |