raccoon.core.badhnati.xml
Class MessageToXml

java.lang.Object
  extended by raccoon.core.badhnati.xml.MessageToXml

public class MessageToXml
extends java.lang.Object

Converts an IMessage instance into an XML String.

Since:
Raccoon v1.0
Version:
$Id: MessageToXml.java,v 1.2 2004/08/11 21:15:42 crouvrais Exp $
Author:
Cedric ROUVRAIS

Constructor Summary
MessageToXml()
          Default constructor.
 
Method Summary
protected  void extractBusMsgParams(java.lang.StringBuffer pXmlBuffer, IBusMessage pMessage)
          Generates the parameters that are specific to a bus message.
protected  void extractMsgPayload(java.lang.String pIndent, java.lang.StringBuffer pXmlBuffer, IMessage pMessage)
          Walks through all the fields of the given IMessage instance.
 int getIndent()
          The number of spaces used for thie indentation.
 boolean isFastMode()
          Indicates whether the Renderer is in fast mode.
 java.lang.String marshal(IField pField)
          Generates the XML String for a IField instance.
 java.lang.String marshal(IMessage pMessage)
          Converts the contents of an IBusMessage into an XML String.
 void setFastMode(boolean pFastMode)
          Defines the rendering mode.
 void setIndent(int pNbSpaces)
          Defines the number of spaces to use for the indentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageToXml

public MessageToXml()
Default constructor.

Method Detail

isFastMode

public boolean isFastMode()
Indicates whether the Renderer is in fast mode.

Returns:
true if in fast mode.

setFastMode

public void setFastMode(boolean pFastMode)
Defines the rendering mode.

Parameters:
pFastMode - true if fast XML generation is required (not beautiful)

setIndent

public void setIndent(int pNbSpaces)
Defines the number of spaces to use for the indentation.

Parameters:
pNbSpaces - the number of spaces, ignored if less than 1.

getIndent

public int getIndent()
The number of spaces used for thie indentation.

Returns:
number of spaces used for a tab

marshal

public java.lang.String marshal(IMessage pMessage)
Converts the contents of an IBusMessage into an XML String.

Parameters:
pMessage - the message to be serialized.
Returns:
the xml string that bears the serialized information.

extractBusMsgParams

protected void extractBusMsgParams(java.lang.StringBuffer pXmlBuffer,
                                   IBusMessage pMessage)
Generates the parameters that are specific to a bus message.

Parameters:
pXmlBuffer - the current XML Buffer to which the elements are to be added.
pMessage - the bus message instance to handle.

extractMsgPayload

protected final void extractMsgPayload(java.lang.String pIndent,
                                       java.lang.StringBuffer pXmlBuffer,
                                       IMessage pMessage)
Walks through all the fields of the given IMessage instance.

Parameters:
pIndent - the current level of indentation within the XML String
pXmlBuffer - the current XML Buffer to which the elements are to be added.
pMessage - the message whose fields are to be marshalled

marshal

public java.lang.String marshal(IField pField)
Generates the XML String for a IField instance.

Parameters:
pField - the field to marshal.
Returns:
the xml string


Copyright null null. All Rights Reserved.