org.objectweb.jorm.metainfo.api

Interface PrimitiveElement

All Superinterfaces:
MetaObject, Serializable, TypedElement
Known Subinterfaces:
ScalarField

public interface PrimitiveElement
extends TypedElement

A PrimitiveElement is a field with a primitive type. Type can be boolean | byte | char | short | int | long | float | double | string | serialized| date | time | timestamp A primitive type can not be extended.

Author:
X. Spengler

Field Summary

static int
CONSTANT_NON_PERSISTENT
static int
CONSTANT_PERSISTENT
static int
VARIABLE_PERSISTENT

Method Summary

int
getScale()
int
getSize()
Returns the size of the field in case of string, serialized, arrays, bigdecimal, etc
int
getStatus()
Gets the status wrt constance and persistence.
boolean
isAutoCalculated()
Indicate if the primitive element is auto calculated.
boolean
isConstant()
boolean
isPersistent()
boolean
isScalar()
Allows to know if the current Field is a scalar field or not.
void
setIsAutoCalculated(boolean autocalculated)
void
setStatus(int status)
Assigns the status indicating if the primitive element is one of:
  • variable and persistent (classical case)
  • constant and persistent
  • constant and not persistent

Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject

getParent, setParent

Methods inherited from interface org.objectweb.jorm.metainfo.api.TypedElement

getName, getType

Field Details

CONSTANT_NON_PERSISTENT

public static final int CONSTANT_NON_PERSISTENT

Field Value:
3


CONSTANT_PERSISTENT

public static final int CONSTANT_PERSISTENT

Field Value:
2


VARIABLE_PERSISTENT

public static final int VARIABLE_PERSISTENT

Field Value:
1

Method Details

getScale

public int getScale()


getSize

public int getSize()
Returns the size of the field in case of string, serialized, arrays, bigdecimal, etc

Returns:
the size for this type


getStatus

public int getStatus()
Gets the status wrt constance and persistence.

See Also:
this.setStatus()


isAutoCalculated

public boolean isAutoCalculated()
Indicate if the primitive element is auto calculated. In case of a CompositeName, an auto calculated field means that the value is calculated by an external tool. In case of a class, an auto calculated field means that the value is calculated by the data support (auto increment value for instance).


isConstant

public boolean isConstant()

Returns:
true if the field is constant


isPersistent

public boolean isPersistent()

Returns:
true if the field is persistent


isScalar

public boolean isScalar()
Allows to know if the current Field is a scalar field or not.

Returns:
true, if the Field is scalar, else false, if the Field is not scalar


setIsAutoCalculated

public void setIsAutoCalculated(boolean autocalculated)

See Also:
this.isAutoCalculated()


setStatus

public void setStatus(int status)
Assigns the status indicating if the primitive element is one of:
  • variable and persistent (classical case)
  • constant and persistent
  • constant and not persistent