raccoon.core.badhnati.xml
Class XmlToMessage

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

public class XmlToMessage
extends java.lang.Object

Converts any XML source into a valid IMessage instance.

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

Constructor Summary
XmlToMessage()
          Default constructor.
 
Method Summary
 IFactory getFactory()
          Retrieves the factory instance used to instanciate empty message objects.
 boolean isFastMode()
          Determines if the fast mode is active.
 boolean isInitialised()
          Is this component initialised or not?
 boolean isStable(boolean pThrowOnError)
          Checks the state of the component.
 void load()
          Loads this component and initializes all dependant components.
 IMessage marshal(org.xml.sax.InputSource pInputSource)
          Converts the content of an XML input source into a IMessage instance.
 IMessage marshal(java.io.Reader pXmlReader)
          Converts the contents of an XML Reader into a IMessage instance.
 IMessage marshal(java.lang.String pXmlMsg)
          Converts a given XML compliant string into a IMessage instance.
 void setFactory(IFactory pFactory)
          Assigns the IFactory used to instanciate empty message objects.
 void setFastMode(boolean pFastMode)
          Defines whether or not the fast mode is to be used.
 void unload()
          Unloads this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlToMessage

public XmlToMessage()
Default constructor.

Method Detail

isFastMode

public boolean isFastMode()
Determines if the fast mode is active.

The fast mode is to be used if the input XML document comes from a sure source. The fast mode doesn't do any particular checking and logging.

For example, if the XML document is generated by the Raccoon Framework service MessageToXml then it is acceptable to use the fast mode.

Returns:
true if the fast mode is active.

setFastMode

public void setFastMode(boolean pFastMode)
Defines whether or not the fast mode is to be used.

The fast mode is to be used if the input XML document comes from a sure source. The fast mode doesn't do any particular checking and logging.

For example, if the XML document is generated by the Raccoon Framework service MessageToXml then it is acceptable to use the fast mode.

Parameters:
pFastMode - the mode of the analysis to use for the XML Document.

getFactory

public IFactory getFactory()
Retrieves the factory instance used to instanciate empty message objects.

Returns:
the IFactory instance used

setFactory

public void setFactory(IFactory pFactory)
Assigns the IFactory used to instanciate empty message objects.

Parameters:
pFactory - the factory instance to use.

isInitialised

public boolean isInitialised()
Is this component initialised or not?

Returns:
true if the method load() has been invoked.

marshal

public IMessage marshal(java.lang.String pXmlMsg)
                 throws RaccoonException
Converts a given XML compliant string into a IMessage instance.

Parameters:
pXmlMsg - the XML string
Returns:
the IMessage instance.
Throws:
RaccoonException - if the XML string is invalid.

marshal

public IMessage marshal(java.io.Reader pXmlReader)
                 throws RaccoonException
Converts the contents of an XML Reader into a IMessage instance.

Parameters:
pXmlReader - the XML string
Returns:
the IMessage instance.
Throws:
RaccoonException - if the XML string is invalid.

marshal

public IMessage marshal(org.xml.sax.InputSource pInputSource)
                 throws RaccoonException
Converts the content of an XML input source into a IMessage instance.

Parameters:
pInputSource - the XML input source
Returns:
the IMessage instance.
Throws:
RaccoonException - if the XML string is invalid.

load

public void load()
          throws RaccoonException
Loads this component and initializes all dependant components.

Throws:
RaccoonException - if the loading fails or if the component is already loaded.

unload

public void unload()
            throws RaccoonException
Unloads this component.

Throws:
RaccoonException - if the unloading fails, or if the component isn't running.

isStable

public boolean isStable(boolean pThrowOnError)
                 throws RaccoonException
Checks the state of the component.

Parameters:
pThrowOnError - if the component is unstable should an exception be thrown?
Returns:
true if the component is in a stable state.
Throws:
RaccoonException - if pThrowOnError is true and if the component is in an unstable state


Copyright null null. All Rights Reserved.