raccoon.tibco.tibrv.badhnati.xml
Class TibrvMsgParser

java.lang.Object
  extended by raccoon.core.types.AbsComponent
      extended by raccoon.core.types.AbsLoadable
          extended by raccoon.core.types.AbsConfigurableLoadable
              extended by raccoon.tibco.tibrv.badhnati.xml.TibrvMsgParser
All Implemented Interfaces:
IBadhnAti, IBaseComponent, IConfigurable, ILoadable, ILogable, IXmlToTibrvMsg

public class TibrvMsgParser
extends AbsConfigurableLoadable
implements IXmlToTibrvMsg

TODO Document this class.

Since:
Raccoon v1.0
Version:
$Id:$
Author:
Cedric ROUVRAIS

Field Summary
static java.lang.String PTY_FAST_MODE
          The fast XML Rendering mode property.
static java.lang.String PTY_XML_INDENTATION
          The indentation
 
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable
mConfigurableManager
 
Fields inherited from class raccoon.core.types.AbsLoadable
mIsLoaded
 
Fields inherited from class raccoon.core.types.AbsComponent
mIsInError
 
Constructor Summary
TibrvMsgParser()
           
 
Method Summary
 java.lang.String bindFrom(com.tibco.tibrv.TibrvMsg pTibrvMsg)
          Converts the provided TibrvMsg instance into the corresponding XML Message instance.
 com.tibco.tibrv.TibrvMsg bindTo(java.lang.String pXmlMessage)
          Converts an XML message instance into a valid TIB/Rendezvous message.
 void configureParameters()
          Configures the various parameters for this component.
 int getXmlIndentation()
          Retrieves the number of spaces used for the XML indentation.
 boolean isFastMode()
          Indicates whether the Renderer is in fast mode.
 void load()
          Loads or initializes the component.
 com.tibco.tibrv.TibrvMsg marshal(java.io.Reader pReader)
           
 void setFastMode(boolean pFastMode)
          Defines the rendering mode.
 void setXmlIndentation(int pXmlIndentation)
          Defines the number of spaces to use for the XML indentation.
 
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable
isStable, setConfigurableManager, setLogger
 
Methods inherited from class raccoon.core.types.AbsLoadable
getLog, isInError, isInitialised, isRunning, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PTY_FAST_MODE

public static final java.lang.String PTY_FAST_MODE
The fast XML Rendering mode property.

See Also:
Constant Field Values

PTY_XML_INDENTATION

public static final java.lang.String PTY_XML_INDENTATION
The indentation

See Also:
Constant Field Values
Constructor Detail

TibrvMsgParser

public TibrvMsgParser()
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)
                 throws ResourceNotFoundException
Defines the rendering mode.

Parameters:
pFastMode - true if fast XML generation is required (not beautiful)
Throws:
ResourceNotFoundException - if there is an internal error.

configureParameters

public void configureParameters()
Configures the various parameters for this component. This method should configure the instance of IConfigurableManager provided during the invocation of AbsConfigurableLoadable.setConfigurableManager(IConfigurableManager).

Specified by:
configureParameters in interface IConfigurable
Overrides:
configureParameters in class AbsConfigurableLoadable

getXmlIndentation

public int getXmlIndentation()
Retrieves the number of spaces used for the XML indentation.

Returns:
the number of spaces, -1 if using default.

setXmlIndentation

public void setXmlIndentation(int pXmlIndentation)
                       throws java.lang.IllegalArgumentException,
                              RaccoonException
Defines the number of spaces to use for the XML indentation.

Parameters:
pXmlIndentation - the number of spaces when indenting the XML string.
Throws:
java.lang.IllegalArgumentException - if the indentation isn't greater than 0
RaccoonException - if this component is already running: the component can't be changed. Error code is ErrorCodes.COMPONENT_INITIALISED

load

public void load()
          throws java.lang.IllegalStateException,
                 LoadableException
Loads or initializes the component.

Specified by:
load in interface ILoadable
Overrides:
load in class AbsConfigurableLoadable
Throws:
LoadableException - if the component couldn't load itself.
java.lang.IllegalStateException - if the component isn't in a state to load itself. for example it is already loaded.

bindFrom

public java.lang.String bindFrom(com.tibco.tibrv.TibrvMsg pTibrvMsg)
                          throws RaccoonException
Converts the provided TibrvMsg instance into the corresponding XML Message instance.

Specified by:
bindFrom in interface IXmlToTibrvMsg
Parameters:
pTibrvMsg - the TIB/Rendezvous message to be serialized.
Returns:
the XML Message instance.
Throws:
RaccoonException - in case of an error.

bindTo

public com.tibco.tibrv.TibrvMsg bindTo(java.lang.String pXmlMessage)
                                throws RaccoonException
Converts an XML message instance into a valid TIB/Rendezvous message.

Specified by:
bindTo in interface IXmlToTibrvMsg
Parameters:
pXmlMessage - the XML Message to convert into a TIB/Rendezvous message.
Returns:
the TIB/Rendezvous message.
Throws:
RaccoonException - if the conversion process fails.

marshal

public com.tibco.tibrv.TibrvMsg marshal(java.io.Reader pReader)
                                 throws RaccoonException
Throws:
RaccoonException


Copyright null null. All Rights Reserved.