com.sun.jaw.impl.mapper
Class DefaultMapper

java.lang.Object
  |
  +--com.sun.jaw.impl.mapper.DefaultMapper

public class DefaultMapper
extends java.lang.Object
implements MapperSrvIf

The DefaultMapper class provides an implementation of a mapping service.

The implementation uses pattern matching rules for providing its services. In order to determine the name of the Java class to use for representing a C-bean, the class will first extract the class name contained in the object name. Then, if the class name ends with

If the class name does not end with one of the two previous suffixes, then the mapper will add the "MOStub" suffix at the end of the class name.

In order to determine the name of the Java class to use for representing an M-bean, the class will first extract the class name contained in the object name. Then, if the class name ends with

If the class name does not end with one of the two previous suffixes, then the mapper will return the class name unchanged.

See Also:
MapperSrvIf

Field Summary
protected  java.lang.String MO
          MO suffix
protected  int MO_length
           
protected  java.lang.String MOStub
          MOStub suffix
protected  int MOStub_length
           
protected  java.lang.String Stub
          Stub suffix
 
Constructor Summary
DefaultMapper()
           
DefaultMapper(java.lang.String mo, java.lang.String mostub)
          Allows to create a default mapper using different suffixes.
 
Method Summary
 java.lang.String cbeanToUse(ObjectName name)
          Get name of a Java class to use for representing a C-bean.
static java.lang.String getClassVersion()
          Returns the version of this class.
 java.lang.String mbeanToUse(ObjectName name)
          Get name of a Java class to use for representing an M-bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MO

protected java.lang.String MO
MO suffix

MO_length

protected int MO_length

Stub

protected java.lang.String Stub
Stub suffix

MOStub

protected java.lang.String MOStub
MOStub suffix

MOStub_length

protected int MOStub_length
Constructor Detail

DefaultMapper

public DefaultMapper()

DefaultMapper

public DefaultMapper(java.lang.String mo,
                     java.lang.String mostub)
Allows to create a default mapper using different suffixes.
Method Detail

cbeanToUse

public java.lang.String cbeanToUse(ObjectName name)
                            throws MappingException
Get name of a Java class to use for representing a C-bean.
Specified by:
cbeanToUse in interface MapperSrvIf
Parameters:
name - The logical name of the object for which the implementing name is requested.
Returns:
The name of the Java class to use for representing the C-bean.
Throws:
MappingException - An error occurs.

mbeanToUse

public java.lang.String mbeanToUse(ObjectName name)
                            throws MappingException
Get name of a Java class to use for representing an M-bean.
Specified by:
mbeanToUse in interface MapperSrvIf
Parameters:
name - The logical name of the object for which the implementing name is requested.
Returns:
The name of the Java class to use for representing the M-bean.
Throws:
MappingException - An error occurs.

getClassVersion

public static java.lang.String getClassVersion()
Returns the version of this class.