Previous Table of Contents Next


19.4 Java Data Types

   Creation of primitive data type instances for the Java language is straightforward because they are all simple, unparameterized types. These primitive data types are used for simple declarations and for building more complex data types implemented as Java classes. Even such common data types as String are implemented as classes in Java. The CWM ObjectModel provides sufficient support for the description of Java classes that CWM classes (notably, Class and Attribute) should be used directly to define any needed Java classes. Consequently, CWM need not provide metamodel classes supporting the definition of Java classes or primitive data types -- the available CWM classes are sufficient.

   The Java language specification provides additional semantics about the meaning of, and restrictions on, primitive data types. For example, the int data type is restricted to integer values in the range -27 to 27 - 1. However, because these restrictions are constant for all variables of type int, they do not need to be encoded into the metamodel. Consequently, the DataType class is sufficient as the container of all Java primitive data types as is shown the following table.

Data type

Instance of

Attributes

boolean DataType None
char DataType None
byte DataType None
short DataType None
int DataType None
long DataType None
double DataType None
float DataType None