com.codestreet.messageforge
Class RFldMap

java.lang.Object
  extended bycom.codestreet.messageforge.RFldMap
All Implemented Interfaces:
RFldMapInterface

public class RFldMap
extends java.lang.Object
implements RFldMapInterface

This class is used to implement the field name mapping within the framework. Fields in a messages can be associated with named groups. Each named group is a collection of field names from one or more messages. The idea is that each field in a named group has the same business semantics.

Author:
Jawaid Hakim.

Method Summary
 void add(java.lang.String fldGrpName, java.lang.String msgName, java.lang.String fldName)
          Add a mapping of a message/field to a field group.
static RFldMap getInstance()
          Get singleton instance.
 boolean hasMapping(java.lang.String fldGrpName, java.lang.String msgName)
          Check if a mapping exists for a field group and a target message.
 java.lang.String map(java.lang.String fldGrpName, java.lang.String msgName)
          Map a field group and a target message to the corresponding field name in that message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RFldMap getInstance()
Get singleton instance.

Returns:
Singleton instance.

add

public void add(java.lang.String fldGrpName,
                java.lang.String msgName,
                java.lang.String fldName)
Add a mapping of a message/field to a field group.

Parameters:
fldGrpName - Field group name.
msgName - Message name.
fldName - Field name.

map

public java.lang.String map(java.lang.String fldGrpName,
                            java.lang.String msgName)
Map a field group and a target message to the corresponding field name in that message.

Specified by:
map in interface RFldMapInterface
Parameters:
fldGrpName - Name of the field group.
msgName - Name of the target message.
Returns:
Name of the target field. Returns null if the target field is not found.

hasMapping

public boolean hasMapping(java.lang.String fldGrpName,
                          java.lang.String msgName)
Check if a mapping exists for a field group and a target message.

Specified by:
hasMapping in interface RFldMapInterface
Parameters:
fldGrpName - Name of the field group.
msgName - Name of the target message.
Returns:
Returns true if the mapping exists. Otherwise, returns false.


Copyright © 2003-2006 CodeStreet. All Rights Reserved.