org.objectweb.jorm.metainfo.lib
Class BasicGenClass

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

public class BasicGenClass
extends BasicMetaObject
implements GenClass

BasicGenClass is the implementation of the GenClass interface defined in the Meta information system. This object is defines by a name, a list of index fields, and its parent.

Author:
X. Spengler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Constructor Summary
BasicGenClass(java.lang.String name, boolean isAbstract, MetaObject parent)
          Builds a new BasicGenClass object.
 
Method Summary
 PrimitiveElement createIndexField(java.lang.String indexFieldName, PType type)
          Returns a new PrimitiveElement object, created with its name and its type (PType).
protected  java.util.Collection getChildren()
           
 PrimitiveElement getIndexField(java.lang.String indexFieldName)
          Returns the PrimitiveElement corresponding to its name.
 int getIndexFieldNumber()
          Returns the number of index fields for the current generic class.
 java.lang.String getName()
          Allows to know the name of the current generic class object.
 java.util.Iterator iterateIndexField()
          Allows to know all the existing index field for the current generic class.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getLogger, getLoggerFactory, getManager, getParent, setLogger, setLoggerFactory, setLoggingOnChild, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Constructor Detail

BasicGenClass

public BasicGenClass(java.lang.String name,
                     boolean isAbstract,
                     MetaObject parent)
Builds a new BasicGenClass object. This object is built with its name, and its parent.

Parameters:
name - the name of the generic class
isAbstract - true, the generic class is an abstract class, else false, the generic class is not an abstract class
parent - the parent meta-object of the current GenClass
Method Detail

getName

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

Specified by:
getName in interface GenClass
Returns:
the string representation of the generic class name

createIndexField

public PrimitiveElement createIndexField(java.lang.String indexFieldName,
                                         PType type)
Returns a new PrimitiveElement object, created with its name and its type (PType). As the current Class is generic, the field of the class is an index field. If the field already exists, it is returned, else a new one is created.

Specified by:
createIndexField in interface GenClass
Parameters:
indexFieldName - the name of the index field
type - the type of the index field
Returns:
a new PrimitiveField for the current generic class

getIndexField

public PrimitiveElement getIndexField(java.lang.String indexFieldName)
Returns the PrimitiveElement corresponding to its name. If no field corresponds to this name, null is returned.

Specified by:
getIndexField in interface GenClass
Parameters:
indexFieldName - the name of the index field
Returns:
an existing index field. If the index field does not exist, null is returned.

iterateIndexField

public java.util.Iterator iterateIndexField()
Allows to know all the existing index field for the current generic class. This iterator contains PrimitiveElement objects. If no index field exists, an empty iterator is returned.

Specified by:
iterateIndexField in interface GenClass
Returns:
an Iterator on index field (PrimitiveElement). If there is no index field to return, an empty iterator is returned.

getIndexFieldNumber

public int getIndexFieldNumber()
Returns the number of index fields for the current generic class.

Specified by:
getIndexFieldNumber in interface GenClass
Returns:
the integer number of the index fields for the generic class

getChildren

protected java.util.Collection getChildren()
Overrides:
getChildren in class BasicMetaObject