org.objectweb.jorm.metainfo.lib
Class BasicCompositeName

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

public class BasicCompositeName
extends java.lang.Object
implements CompositeName, Loggable

The BasicCompositeName provides an implementation of the composite name. Composite Name are used to define composite pname. Composite Name defines the multiple fields describing the structure os a name.

Author:
N. De Palma
See Also:
Serialized Form

Constructor Summary
BasicCompositeName(java.lang.String className, MetaObject parent)
          Builds a new CompositeName object.
 
Method Summary
 void addInheritedCompositeName(CompositeName cn)
          Add an inherited composite name to the current composite name.
 ScalarField createCompositeNameField(java.lang.String fieldname, PType type, int size)
          Build a new scalarfield that describes a field in the composite name
 java.util.Collection getAllField()
           
 int getFieldNumber()
          Give the number of fields composing the current composite name.
 java.lang.String getFQName()
          Allows to know the fully qualifed name of the current CompositeName object.
 CompositeName getInheritedCompositeName(java.lang.String name)
          Retrieve an inherited composite name form its name.
 int getInheritedCompositeNameNumber()
          Returns the number of inherited composite name for the current composite name object.
 Logger getLogger()
          Returns a logger to an component that wants to log things.
 LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 java.lang.String getName()
          Allows to know the name of the current CompositeName object.
 MetaObject getParent()
          Allows to know the parent MetaObject of the current MetaObject.
 ScalarField getScalarField(java.lang.String fieldname)
          Retrieve a scalarfield describing the field identified by it name in the current compositename.
 java.util.Iterator iterateAllField()
          Provides an iterator over the field of the current composite name including the inherited fields.
 java.util.Iterator iterateField()
          Provides an iterator over the field of the current composite name.
 java.util.Iterator iterateInheritedCompositeName()
          Provides an iterator over all the composite name inherited by the current composite name.
 void setLogger(Logger logger)
          Defines a logger object.
 void setLoggerFactory(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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicCompositeName

public BasicCompositeName(java.lang.String className,
                          MetaObject parent)
Builds a new CompositeName object. This object is mainly defined by its name.

Parameters:
className - the name of the current class
parent - the parent of the current object
Method Detail

getName

public java.lang.String getName()
Allows to know the name of the current CompositeName object.

Specified by:
getName in interface CompositeName
Returns:
the string representation of the name of the CompositeName

getFQName

public java.lang.String getFQName()
Allows to know the fully qualifed name of the current CompositeName object.

Specified by:
getFQName in interface CompositeName
Returns:
the string representation of the name of the CompositeName

addInheritedCompositeName

public void addInheritedCompositeName(CompositeName cn)
Add an inherited composite name to the current composite name.

Specified by:
addInheritedCompositeName in interface CompositeName
Parameters:
cn - the name of the composite name to be inherited.

iterateInheritedCompositeName

public java.util.Iterator iterateInheritedCompositeName()
Provides an iterator over all the composite name inherited by the current composite name.

Specified by:
iterateInheritedCompositeName in interface CompositeName
Returns:
the iterator embeding inherited composite name objects.

getInheritedCompositeName

public CompositeName getInheritedCompositeName(java.lang.String name)
Retrieve an inherited composite name form its name.

Specified by:
getInheritedCompositeName in interface CompositeName
Parameters:
name - the name of the composite name
Returns:
the composite name

getScalarField

public ScalarField getScalarField(java.lang.String fieldname)
Retrieve a scalarfield describing the field identified by it name in the current compositename.

Specified by:
getScalarField in interface CompositeName
Parameters:
fieldname - the name of the field.
Returns:
the scalarfield describing the field.

getInheritedCompositeNameNumber

public int getInheritedCompositeNameNumber()
Returns the number of inherited composite name for the current composite name object.

Specified by:
getInheritedCompositeNameNumber in interface CompositeName
Returns:
the number of inherited compositename.

createCompositeNameField

public ScalarField createCompositeNameField(java.lang.String fieldname,
                                            PType type,
                                            int size)
Build a new scalarfield that describes a field in the composite name

Specified by:
createCompositeNameField in interface CompositeName
Parameters:
fieldname - the name of the field
type - the ptype of the field
Returns:
the scalarfield

getFieldNumber

public int getFieldNumber()
Give the number of fields composing the current composite name.

Specified by:
getFieldNumber in interface CompositeName
Returns:
the fields number.

iterateField

public java.util.Iterator iterateField()
Provides an iterator over the field of the current composite name.

Specified by:
iterateField in interface CompositeName
Returns:
the iterator embeding scalarfield object

iterateAllField

public java.util.Iterator iterateAllField()
Provides an iterator over the field of the current composite name including the inherited fields.

Specified by:
iterateAllField in interface CompositeName
Returns:
the iterator embeding scalarfield object

getAllField

public java.util.Collection getAllField()

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(Logger logger)
Defines a logger object.

Specified by:
setLogger in interface Loggable
Parameters:
logger - the logger object

setLoggerFactory

public void setLoggerFactory(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 Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.

Specified by:
getLogger in interface Loggable

getLoggerFactory

public LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.

Specified by:
getLoggerFactory in interface Loggable