net.sf.beep4j.internal.message
Class DefaultMessageBuilder

java.lang.Object
  extended by net.sf.beep4j.internal.message.DefaultMessageBuilder
All Implemented Interfaces:
MessageBuilder

public class DefaultMessageBuilder
extends java.lang.Object
implements MessageBuilder


Constructor Summary
DefaultMessageBuilder()
           
 
Method Summary
 void addHeader(java.lang.String name, java.lang.String value)
          Adds an arbitrary header field.
 java.nio.ByteBuffer getContentBuffer(int size)
          Allocates a ByteBuffer into which the message content can be written.
 Message getMessage()
          Retrieves the resulting message object.
 java.io.OutputStream getOutputStream()
          Gets the underlying OutputStream that can be used to write binary messages.
 java.io.Writer getWriter()
          Gets the underlying Writer that can be used to write textual messages.
 void setCharsetName(java.lang.String charset)
          Sets the character encoding used by the message.
 void setContentType(java.lang.String type, java.lang.String subtype)
          Sets the content type of the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessageBuilder

public DefaultMessageBuilder()
Method Detail

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Description copied from interface: MessageBuilder
Adds an arbitrary header field.

Specified by:
addHeader in interface MessageBuilder
Parameters:
name - the name of the header
value - the value

setCharsetName

public void setCharsetName(java.lang.String charset)
Description copied from interface: MessageBuilder
Sets the character encoding used by the message.

Specified by:
setCharsetName in interface MessageBuilder
Parameters:
charset - the charset

setContentType

public void setContentType(java.lang.String type,
                           java.lang.String subtype)
Description copied from interface: MessageBuilder
Sets the content type of the message.

Specified by:
setContentType in interface MessageBuilder
Parameters:
type - the type
subtype - the subtype

getOutputStream

public java.io.OutputStream getOutputStream()
Description copied from interface: MessageBuilder
Gets the underlying OutputStream that can be used to write binary messages.

Specified by:
getOutputStream in interface MessageBuilder
Returns:
the OutputStream

getWriter

public java.io.Writer getWriter()
Description copied from interface: MessageBuilder
Gets the underlying Writer that can be used to write textual messages.

Specified by:
getWriter in interface MessageBuilder
Returns:
the Writer

getContentBuffer

public java.nio.ByteBuffer getContentBuffer(int size)
Description copied from interface: MessageBuilder
Allocates a ByteBuffer into which the message content can be written.

Specified by:
getContentBuffer in interface MessageBuilder
Parameters:
size - the size of the ByteBuffer
Returns:
an allocated ByteBuffer

getMessage

public Message getMessage()
Description copied from interface: MessageBuilder
Retrieves the resulting message object.

Specified by:
getMessage in interface MessageBuilder
Returns:
the Message object


Copyright © 2007 null. All Rights Reserved.