org.objectweb.jorm.metainfo.lib
Class BasicScalarField

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.metainfo.lib.BasicTypedElement
          extended byorg.objectweb.jorm.metainfo.lib.BasicPrimitiveElement
              extended byorg.objectweb.jorm.metainfo.lib.BasicScalarField
All Implemented Interfaces:
java.lang.Comparable, Loggable, MetaObject, PrimitiveElement, ScalarField, java.io.Serializable, TypedElement

public class BasicScalarField
extends BasicPrimitiveElement
implements ScalarField

A ScalarField describes corresponds to a hidden field of a ClassObject or a Generic Class. For Classes, it is typically used to represent PNames. For Generic Class, it can also be used for the index attributes of the Generic Class.

Author:
X. Spengler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Fields inherited from interface org.objectweb.jorm.metainfo.api.PrimitiveElement
CONSTANT_NON_PERSISTENT, CONSTANT_PERSISTENT, VARIABLE_PERSISTENT
 
Constructor Summary
BasicScalarField(java.lang.String name, PType type, int size, int scale, MetaObject parent)
          Builds a new BasicScalarField object.
 
Method Summary
 java.lang.String getNullValue()
          get the null value for this field.
 java.lang.Object getNullValueObject()
          get the null value for this field
 boolean hasNullValue()
          Test if the null value exists for this field.
static java.lang.Object parseValue(PType type, java.lang.String value)
           
 void setNullValue(java.lang.String value)
          Set the null value for this field.
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicPrimitiveElement
getScale, getSize, getStatus, isAutoCalculated, isConstant, isPersistent, isScalar, setIsAutoCalculated, setStatus
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicTypedElement
compareTo, getName, getType
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getChildren, 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.PrimitiveElement
getScale, getSize, getStatus, isAutoCalculated, isConstant, isPersistent, isScalar, setIsAutoCalculated, setStatus
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.TypedElement
getName, getType
 
Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject
getParent, setParent
 

Constructor Detail

BasicScalarField

public BasicScalarField(java.lang.String name,
                        PType type,
                        int size,
                        int scale,
                        MetaObject parent)
Builds a new BasicScalarField object.

Parameters:
name - the name of the scalar field
type - the PType of the field
parent - the parent meta-object of the current field
Method Detail

setNullValue

public void setNullValue(java.lang.String value)
Set the null value for this field.

Specified by:
setNullValue in interface ScalarField
Parameters:
value - a string representation of the nullvalue

getNullValue

public java.lang.String getNullValue()
get the null value for this field.

Specified by:
getNullValue in interface ScalarField
Returns:
the string representation of the null value or null if there is no null value for this field.

getNullValueObject

public java.lang.Object getNullValueObject()
Description copied from interface: ScalarField
get the null value for this field

Specified by:
getNullValueObject in interface ScalarField
Returns:
an object representing the null value according to the field type. For instance a null value for a byte scalar field is stored into a java.lang.Byte object.

hasNullValue

public boolean hasNullValue()
Test if the null value exists for this field.

Specified by:
hasNullValue in interface ScalarField
Returns:
true if the null value exist for this field.

parseValue

public static java.lang.Object parseValue(PType type,
                                          java.lang.String value)
                                   throws java.lang.NumberFormatException,
                                          java.text.ParseException,
                                          PException
Throws:
java.lang.NumberFormatException
java.text.ParseException
PException