org.objectweb.jorm.metainfo.lib
Class BasicNameRef

java.lang.Object
  |
  +--org.objectweb.jorm.metainfo.lib.BasicNameRef
All Implemented Interfaces:
Loggable, MetaObject, NameRef, java.io.Serializable

public class BasicNameRef
extends java.lang.Object
implements NameRef, Loggable

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

Constructor Summary
BasicNameRef(java.lang.String name, 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 getCNSchemaName()
          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.
 org.objectweb.util.monolog.api.Logger getLogger()
          Returns a logger to an component that wants to log things.
 org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 java.lang.String getName()
          Retrieve the name of the nameref.
 MetaObject getParent()
          Allows to know the parent MetaObject of the current MetaObject.
 java.util.Map getProjection()
          Retrieve the list of projections between the fields of the composite name and the field of the class.
 void setLogger(org.objectweb.util.monolog.api.Logger logger)
          Defines a logger object.
 void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerFactory)
          Defines the logger factory to obtain new logger.
 void setParent(MetaObject itsParent)
          Set the parent of the current meta object if it is not yet done by the constructor of the meta object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicNameRef

public BasicNameRef(java.lang.String name,
                    CompositeName cn_Class,
                    MetaObject parent)
Builds a new BasicNameRef object.
Parameters:
name - the name of the nameref, it is the name of the referenced compositename
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.

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)
Overrides:
equals in class java.lang.Object

getCNSchemaName

public java.lang.String getCNSchemaName()
Description copied from interface: NameRef
Return the name of the schema for the composite name referenced by this nameref.
Specified by:
getCNSchemaName 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
Returns:
true if the schema name ans the compositename name are equal.

getParent

public MetaObject getParent()
Allows to know the parent MetaObject of the current MetaObject.
Specified by:
getParent in interface MetaObject
Returns:
the MetaObject corresponding to the parent of the current object. If there is no parent, null is returned.

setParent

public void setParent(MetaObject itsParent)
Set the parent of the current meta object if it is not yet done by the constructor of the meta object
Specified by:
setParent in interface MetaObject
Parameters:
itsParent - the parent MetaObject of the current object

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger logger)
Defines a logger object.
Specified by:
setLogger in interface Loggable
Parameters:
logger - the logger object

setLoggerFactory

public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerFactory)
Defines the logger factory to obtain new logger.
Specified by:
setLoggerFactory in interface Loggable
Parameters:
loggerFactory - the LoggerFactory object to obtain a logger object

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.
Specified by:
getLogger in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
logger - the logger object

getLoggerFactory

public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.
Specified by:
getLoggerFactory in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers