org.objectweb.jorm.metainfo.api

Interface NameDef

All Superinterfaces:
MetaObject, 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

NameRef
createNameRef(CompositeName cn_Class)
Builds a reference toward a composite name describing the namedef.
String
getFieldName()
Retrieves the name of the field describing the namedef.
int
getFieldNumber()
Returns the number of fields which composed the current object.
String
getName()
Returns the name of the NameDef object.
NameRef
getNameRef()
Retrieves the nameref if the namedef is a composite one.
boolean
isFieldName()
Allows to know if the namedef is describe by a single field.
boolean
isNameRef()
Allows 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).
Iterator
iterateField()
Returns an iterator on all fields (HiddenFields and FieldRef).
void
setFieldName(String fieldname)
Allows to set the fieldname describing the namedef single field.
void
setName(String name)
Sets the name of the NameDef object.
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 Details

createNameRef

public NameRef createNameRef(CompositeName cn_Class)
Builds a reference toward a composite name describing the namedef.

Parameters:
cn_Class - the meta object representing the composite name.

Returns:
the nameref metaobject describing the reference.


getFieldName

public String getFieldName()
Retrieves 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.


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


getName

public String getName()
Returns the name of the NameDef object.

Returns:
the name of the NameDef object.


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.


isFieldName

public boolean isFieldName()
Allows to know if the namedef is describe by a single field.

Returns:
true the namedef is a single one.


isNameRef

public boolean isNameRef()
Allows to know if the namedef is describe by a composite name.

Returns:
true the namedef is a composite one.


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)).


iterateField

public 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


setFieldName

public void setFieldName(String fieldname)
Allows to set the fieldname describing the namedef single field.

Parameters:
fieldname - the fieldname


setName

public void setName(String name)
Sets the name of the NameDef object.

Parameters:
name - the name of the NameDef object.


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)).