com.codestreet.messageforge
Class RMsgFactoryImpl

java.lang.Object
  extended bycom.codestreet.messageforge.RMsgFactoryImpl
All Implemented Interfaces:
RMsgFactory

public class RMsgFactoryImpl
extends java.lang.Object
implements RMsgFactory

Factory implementation.

Author:
Jawaid Hakim.

Method Summary
 RMapMessage createMsgObject(java.lang.Class cls)
          Create message instance from Class.
 RMapMessage createMsgObject(java.lang.Class cls, boolean create)
          Create message instance from Class.
 RMapMessage createMsgObject(java.lang.String msgName)
          Create message instance from message name.
 RMapMessage createMsgObject(java.lang.String msgName, boolean create)
          Create message instance from message name.
 java.lang.String[] getBeanFieldNames()
          Get all bean field class names in this factory.
 java.lang.String getFullBeanFieldName(java.lang.String beanField)
          Get fully qualified name of specified bean field.
static RMsgFactoryImpl getInstance()
          Get singleton instance.
 java.lang.String[] getMsgNames()
          Get all message names in this factory.
 java.lang.String getQualifiedName(java.lang.String msgName)
          Get the fully qualified name of message class for given message name.
 void setDefaultMsgFactories(RMsgFactory[] factories)
          Register message factories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RMsgFactoryImpl getInstance()
Get singleton instance.

Returns:
Singleton instance.

setDefaultMsgFactories

public void setDefaultMsgFactories(RMsgFactory[] factories)
                            throws ConverterException
Register message factories.

Parameters:
factories - Message factoies.
Throws:
ConverterException

createMsgObject

public RMapMessage createMsgObject(java.lang.String msgName)
                            throws FactoryException
Description copied from interface: RMsgFactory
Create message instance from message name. The message name is the fully qualified (including package specification) name of the message class.

Specified by:
createMsgObject in interface RMsgFactory
Parameters:
msgName - Message name.
Returns:
Message instance.
Throws:
FactoryException

createMsgObject

public RMapMessage createMsgObject(java.lang.String msgName,
                                   boolean create)
                            throws FactoryException
Description copied from interface: RMsgFactory
Create message instance from message name. The message name is the fully qualified (including package specification) name of the message class.

Specified by:
createMsgObject in interface RMsgFactory
Parameters:
msgName - Message name.
create - If true then nested fields of type MSGOBJ and BEAN are precreated.
Returns:
Message instance.
Throws:
FactoryException

createMsgObject

public RMapMessage createMsgObject(java.lang.Class cls)
                            throws FactoryException
Description copied from interface: RMsgFactory
Create message instance from Class.

Specified by:
createMsgObject in interface RMsgFactory
Parameters:
cls - Class.
Returns:
Message instance.
Throws:
FactoryException

createMsgObject

public RMapMessage createMsgObject(java.lang.Class cls,
                                   boolean create)
                            throws FactoryException
Description copied from interface: RMsgFactory
Create message instance from Class.

Specified by:
createMsgObject in interface RMsgFactory
Parameters:
cls - Class.
create - If true then nested fields of type MSGOBJ and BEAN are precreated.
Returns:
Message instance.
Throws:
FactoryException

getMsgNames

public java.lang.String[] getMsgNames()
Description copied from interface: RMsgFactory
Get all message names in this factory.

Specified by:
getMsgNames in interface RMsgFactory
Returns:
Message names in this factory.

getQualifiedName

public java.lang.String getQualifiedName(java.lang.String msgName)
                                  throws FactoryException
Description copied from interface: RMsgFactory
Get the fully qualified name of message class for given message name.

Specified by:
getQualifiedName in interface RMsgFactory
Parameters:
msgName - Message name.
Returns:
Fully qualified name of message class.
Throws:
FactoryException

getBeanFieldNames

public java.lang.String[] getBeanFieldNames()
Description copied from interface: RMsgFactory
Get all bean field class names in this factory.

Specified by:
getBeanFieldNames in interface RMsgFactory
Returns:
All bean field class names in this factory.

getFullBeanFieldName

public java.lang.String getFullBeanFieldName(java.lang.String beanField)
Description copied from interface: RMsgFactory
Get fully qualified name of specified bean field.

Specified by:
getFullBeanFieldName in interface RMsgFactory
Parameters:
beanField - Name of bean field.
Returns:
fully qualified name of specified bean field.


Copyright © 2003-2006 CodeStreet. All Rights Reserved.