org.objectweb.jorm.metainfo.lib
Class BasicNameRef

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.BasicNameRef
All Implemented Interfaces:
Loggable, MetaObject, NameRef, java.io.Serializable

public class BasicNameRef
extends BasicMetaObject
implements NameRef

The BasicNameRef is used to reference a composite name. nameref are used in namedef to define pname with multiple fields.

Author:
N. De Palma
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Constructor Summary
BasicNameRef(CompositeName cn_Class, MetaObject parent)
          Builds a new BasicNameRef object.
 
Method Summary
 void addProjection(java.lang.String namefield, java.lang.String classfield)
          Add a projection between a field in the composite name structure and a field in the class.
 boolean equalCNType(java.lang.Object obj)
          test if the type of the compositename referenced in this nameref is equals to the type referenced by the nameref passed as parameter.
 boolean equals(java.lang.Object nr)
           
 java.lang.String getClassFieldName(java.lang.String fieldName)
          Return the class field name associated with the composite name field name.
 java.lang.String getCNPackageName()
          Return the name of the schema for the composite name referenced by this nameref.
 CompositeName getCompositeName()
          Retrieve the metaobject describing the composite name referenced by this nameref.
 java.lang.String getName()
          Retrieve the name of the nameref.
 java.util.Map getProjection()
          Retrieve the list of projections between the fields of the composite name and the field of the class.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getChildren, getLogger, getLoggerFactory, getManager, getParent, setLogger, setLoggerFactory, setLoggingOnChild, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Constructor Detail

BasicNameRef

public BasicNameRef(CompositeName cn_Class,
                    MetaObject parent)
Builds a new BasicNameRef object.

Parameters:
cn_Class - the composite name referenced by the nameref
parent - the parent meta-object of the current nameref (this is a namedef).
Method Detail

addProjection

public void addProjection(java.lang.String namefield,
                          java.lang.String classfield)
Add a projection between a field in the composite name structure and a field in the class.

Specified by:
addProjection in interface NameRef
Parameters:
namefield - the name of the field in the composite name
classfield - the name of the field in the class

getProjection

public java.util.Map getProjection()
Retrieve the list of projections between the fields of the composite name and the field of the class.

Specified by:
getProjection in interface NameRef
Returns:
a map object describing the projection.

getClassFieldName

public java.lang.String getClassFieldName(java.lang.String fieldName)
Return the class field name associated with the composite name field name.

Specified by:
getClassFieldName in interface NameRef
Parameters:
fieldName - the name of a field in the composite name.
Returns:
a String object containing a class field name.

getName

public java.lang.String getName()
Retrieve the name of the nameref. This name is equal to the name of the referenced composite name.

Specified by:
getName in interface NameRef
Returns:
the nameof the nameref used to describe the current pname.

getCompositeName

public CompositeName getCompositeName()
Retrieve the metaobject describing the composite name referenced by this nameref.

Specified by:
getCompositeName in interface NameRef
Returns:
the composite name.

equals

public boolean equals(java.lang.Object nr)

getCNPackageName

public java.lang.String getCNPackageName()
Description copied from interface: NameRef
Return the name of the schema for the composite name referenced by this nameref.

Specified by:
getCNPackageName in interface NameRef

equalCNType

public boolean equalCNType(java.lang.Object obj)
test if the type of the compositename referenced in this nameref is equals to the type referenced by the nameref passed as parameter.

Specified by:
equalCNType in interface NameRef
Parameters:
obj - the nameref to compare to
Returns:
true if the schema name ans the compositename name are equal.