Void #

The Void class can be used to explicitly specify values that should be unspecified. In some situations, it is important to express such a property, e.g., during the definition of a query. If users can specify that a certain value should not be defined in the case, they can express it with a Void object as an instance of the void class. With sub classes of void, it is possible to specify, why an attribute is not defined.

To create an object of the Void system class, the following line of code:


    VoidObject voidObject = (VoidObject) ModelFactory.getDefaultModel().getVoidSystemClass().newObject();

To define a subclass, that extends the void class, the following code can be used in the model.xml file:


    <VoidClass name="customVoidClass"/>

To create this class during runtime, the following code has to be used:


    VoidClass voidClass = (VoidClass) ModelFactory.getDefaultModel().getVoidSystemClass();
    VoidClass customVoidClass = (VoidClass) voidClass.createSubclass("customVoidClass");
Here, the object voidClass is necessary to access the Void class and to create a subclass of it. The command createSubclass adds the class to the model of ProCAKE.

An object of customVoidClass can be created as follows:


    voidObject = (VoidObject) ModelFactory.getDefaultModel().createObject("customVoidClass");

The XML representation of the void object depicted above is as follows:


    <cdol:V c="Void" id="testVoid"/>