|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectraccoon.core.types.AbsComponent
raccoon.core.types.AbsLoadable
raccoon.core.types.AbsConfigurableLoadable
raccoon.core.badhnati.xml.XmlParser
public class XmlParser
The parser that converts IMessage instances into an XML String or vice-versa.
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 | |
---|---|
XmlParser()
Default constructor. |
Method Summary | |
---|---|
void |
configureParameters()
Configures the various parameters for this component. |
IFactory |
getFactory()
Retrieves the factory to create new message instances used. |
int |
getXmlIndentation()
Retrieves the number of spaces used for the XML indentation. |
boolean |
isFastMode()
Indicates whether the Renderer is in fast mode. |
void |
load()
Invoked by the service manager to start this component once it has been configured. |
IMessage |
marshal(org.xml.sax.InputSource pXmlSource)
Converts a given XML compliant string into a IMessage instance. |
IMessage |
marshal(java.io.Reader pXmlReader)
Converts a given XML compliant string into a RvMsgBase instance. |
IMessage |
marshal(java.lang.String pXmlMsg)
Converts a given XML compliant string into a IMessage instance. |
void |
setFactory(IFactory pFactory)
Defines the factory instance to use. |
void |
setFastMode(boolean pFastMode)
Defines the rendering mode. |
void |
setXmlIndentation(int pXmlIndentation)
Defines the number of spaces to use for the XML indentation. |
void |
unload()
Invoked by the service manager to stop this component. |
java.lang.String |
unmarshal(IMessage pMessage)
Converts the provided IMessage instance into an XML String representation. |
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable |
---|
isStable, setConfigurableManager, setLogger |
Methods inherited from class raccoon.core.types.AbsLoadable |
---|
getLog, isInError, isInitialised, isRunning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PTY_FAST_MODE
public static final java.lang.String PTY_XML_INDENTATION
Constructor Detail |
---|
public XmlParser()
Method Detail |
---|
public boolean isFastMode()
true
if in fast mode.public void setFastMode(boolean pFastMode) throws ResourceNotFoundException
pFastMode
- true
if fast XML generation is required (not beautiful)
ResourceNotFoundException
- if there is an internal error.public void configureParameters()
IConfigurableManager
provided during the invocation of AbsConfigurableLoadable.setConfigurableManager(IConfigurableManager)
.
configureParameters
in interface IConfigurable
configureParameters
in class AbsConfigurableLoadable
public int getXmlIndentation()
-1
if using default.public void setXmlIndentation(int pXmlIndentation) throws java.lang.IllegalArgumentException, RaccoonException
pXmlIndentation
- the number of spaces when indenting the XML string.
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
public IFactory getFactory()
public void setFactory(IFactory pFactory) throws RaccoonException
pFactory
- the factory implementation to create new message instances.
RaccoonException
- if this service is already running.public IMessage marshal(java.lang.String pXmlMsg) throws RaccoonException
IMessage
instance.
marshal
in interface IXmlToMessage
pXmlMsg
- the XML string
IMessage
instance.
RaccoonException
- if the XML string is invalid.public IMessage marshal(java.io.Reader pXmlReader) throws RaccoonException
marshal
in interface IXmlToMessage
pXmlReader
- the XML reader
IMessage
instance.
RaccoonException
- if the XML string is invalid.public IMessage marshal(org.xml.sax.InputSource pXmlSource) throws RaccoonException
IMessage
instance.
marshal
in interface IXmlToMessage
pXmlSource
- the XML input source to use.
IMessage
instance.
RaccoonException
- if the XML string is invalid.public java.lang.String unmarshal(IMessage pMessage)
IMessage
instance into an XML String representation.
unmarshal
in interface IXmlToMessage
pMessage
- the message to be converted
public void load() throws LoadableException
false
and then set to true
once all
the init code has been performed.
load
in interface ILoadable
load
in class AbsConfigurableLoadable
LoadableException
- if this component isn't initialisable or is already running.public void unload() throws LoadableException
true
and then set to false
once all the init code has
been performed.
unload
in interface ILoadable
unload
in class AbsLoadable
LoadableException
- if the composant isn't running or if it isn't an initialisable component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |