org.objectweb.jorm.metainfo.lib
Class BasicExtension

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.BasicExtension
All Implemented Interfaces:
Extension, Loggable, MetaObject, Reference, java.io.Serializable, TypedElement

public class BasicExtension
extends BasicMetaObject
implements Extension, Loggable

See Also:
Serialized Form

Constructor Summary
BasicExtension(Class inheritedClass, MetaObject parent)
          Builds a new BasicClassRef object.
 
Method Summary
 NameDef createRefNameDef()
          Creates a new NameDef object for the current reference class object.
 java.lang.String getClassName()
          Returns the name of the class ref.
 java.lang.String getFQName()
          Returns the fully qualified name of the class ref.
 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.
 Class getMOClass()
          Returns the Class object which describes the ClassRef entity.
 java.lang.String getName()
          Returns the name of the current typed element.
 java.util.Collection getRefNameDef()
          Returns an iterator on existing NameDef for the current Class.
 NameDef getRefNameDef(java.lang.String name)
          Returns a NameDef object.
 PType getType()
          Allows to know the type of the field.
 void setLogger(Logger logger)
          Defines a logger object.
 void setLoggerFactory(LoggerFactory loggerFactory)
          Defines the logger factory to obtain new logger.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getManager, getParent, 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

BasicExtension

public BasicExtension(Class inheritedClass,
                      MetaObject parent)
Builds a new BasicClassRef object. This object is defined by its name, the reference to the class and its parent.

Parameters:
inheritedClass - the reference to the class
parent - the parent of the current object
Method Detail

getMOClass

public Class getMOClass()
Returns the Class object which describes the ClassRef entity. This object is used as the type of a field.

Specified by:
getMOClass in interface Extension
Returns:
the Class Object contained by the current class ref object

getClassName

public java.lang.String getClassName()
Returns the name of the class ref.

Specified by:
getClassName in interface Extension
Returns:
the name of the class reference meta object

getFQName

public java.lang.String getFQName()
Returns the fully qualified name of the class ref.

Specified by:
getFQName in interface Extension
Returns:
the name of the class reference meta object

getName

public java.lang.String getName()
Returns the name of the current typed element.

Specified by:
getName in interface TypedElement
Returns:
the string representation of the typed element

getType

public PType getType()
Allows to know the type of the field.

Specified by:
getType in interface TypedElement
Returns:
a PType object which defines the type of the current field

createRefNameDef

public NameDef createRefNameDef()
Creates a new NameDef object for the current reference class object. If this NameDef already exists for the current object, it is returned, in other case, a new NameDef object is created and returned.

Specified by:
createRefNameDef in interface Reference
Returns:
a new object used to describe the name projection for the current reference class, or an existing one if it already exists

getRefNameDef

public NameDef getRefNameDef(java.lang.String name)
Returns a NameDef object. If the namedef does not exist, null is returned.

Specified by:
getRefNameDef in interface Reference
Parameters:
name - the name of the NameDef object.
Returns:
an existing namedef object, else null is returned.

getRefNameDef

public java.util.Collection getRefNameDef()
Returns an iterator on existing NameDef for the current Class. This method returns an empty iterator if no namedef exists in this Class.

Specified by:
getRefNameDef in interface Reference
Returns:
an iterator on NameDef, or an empty iterator if no namedef is defined

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