org.objectweb.jorm.metainfo.api
Interface NameDef

All Superinterfaces:
MetaObject, java.io.Serializable

public interface NameDef
extends MetaObject

The NameDef interface describes the mapping of a reference field, ut can be the PName of a Class. It can be a Field which is an attribute of the class and is a reference; in this case, the reference can be to another Class (ClassObject) or to a GenClass. A NameDef object is composed of ScalarField(s) and/or FieldName(s), or system defined.

Author:
X. Spengler

Method Summary
 boolean arePresents(java.lang.String mappingName)
          Verifies if the tuple mappername/mappingname is present in the current namedef object.
 NameRef createNameRef(java.lang.String name, CompositeName cn_Class)
          Build a reference toward a composite name describing the namedef.
 java.lang.String getFieldName()
          Retrieve the name of the field describing the namedef.
 int getFieldNumber()
          Returns the number of fields which composed the current object.
 java.util.Iterator getMappNames()
          Retrieve an iterator over the mapping name defined for this NameDef.
 NameRef getNameRef()
          Retrieves the nameref if the namedef is a composite one.
 boolean isFieldName()
          allow to know if the namedef is describe by a single field.
 boolean isNameRef()
          allow to know if the namedef is describe by a composite name.
 boolean isSystem()
          Allows to know if the mapping of the referenced field is defined by another system (could be defined by Versant system for instance).
 java.util.Iterator iterateField()
          Returns an iterator on all fields (HiddenFields and FieldRef).
 void setFieldName(java.lang.String fieldname)
          Allow to set the fieldname describing the namedef single field.
 void setMappNames(java.lang.String mappingName)
          Sets the names of the mapper and the mapping defined for this NameDef.
 void setSystem(boolean system)
          Allows to set if the current NameDef is system defined (defined outside jorm) or not.
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Method Detail

isNameRef

public boolean isNameRef()
allow to know if the namedef is describe by a composite name.
Returns:
true the namedef is a composite one.

isFieldName

public boolean isFieldName()
allow to know if the namedef is describe by a single field.
Returns:
true the namedef is a single one.

createNameRef

public NameRef createNameRef(java.lang.String name,
                             CompositeName cn_Class)
Build a reference toward a composite name describing the namedef.
Parameters:
name - the name of the compsoite name
cn_Class - the meta object representing the composite name.
Returns:
the nameref metaobject describing the reference.

getNameRef

public NameRef getNameRef()
Retrieves the nameref if the namedef is a composite one.
Returns:
the nameref or null if the namedef is a single one or system.

getFieldName

public java.lang.String getFieldName()
Retrieve the name of the field describing the namedef. The fieldname can be the name of a field or an hiddenfield.
Returns:
the fieldname or null is the namedef is a system or a composite one.

setFieldName

public void setFieldName(java.lang.String fieldname)
Allow to set the fieldname describing the namedef single field.
Parameters:
fieldname - the fieldname

isSystem

public boolean isSystem()
Allows to know if the mapping of the referenced field is defined by another system (could be defined by Versant system for instance).
Returns:
true, if the mapping is defined by another system, else false, if the mapping is defined inside JORM (by ScalarField(s) and FieldName(s)).

setSystem

public void setSystem(boolean system)
Allows to set if the current NameDef is system defined (defined outside jorm) or not.
Parameters:
system - true, if the mapping is defined by another system, else false, if the mapping is defined inside JORM (by ScalarField(s) and FieldName(s)).

getFieldNumber

public int getFieldNumber()
Returns the number of fields which composed the current object. these fields are hidden or not
Returns:
the number of fields

iterateField

public java.util.Iterator iterateField()
Returns an iterator on all fields (HiddenFields and FieldRef). This iterator contains FieldName . If no object fields exists, an empty iterator is returned.
Returns:
an iterator on field

setMappNames

public void setMappNames(java.lang.String mappingName)
Sets the names of the mapper and the mapping defined for this NameDef. This method replaces two setters, which are not required because the two String are set in same time.
Parameters:
mappingName - the name of the used mapping

getMappNames

public java.util.Iterator getMappNames()
Retrieve an iterator over the mapping name defined for this NameDef.
Returns:
an iterator containing the mapping name as string.

arePresents

public boolean arePresents(java.lang.String mappingName)
Verifies if the tuple mappername/mappingname is present in the current namedef object. If the current NameDef supports the tuple, true is returned, else false.
Parameters:
mapperName - the name of the mapper
mappingName - the name of the mapping
Returns:
true, if the tuple is present in the current NameDef, else false, if the tuple does not exist in the current NameDef