isRequired()

Find out whether a business object's attribute is defined as a required attribute.

Syntax

boolean isRequired(String attribute)
 

Parameters

attribute
The name of an attribute.

Return values

Returns true if the attribute is required; returns false if it is not required.

Notes

If an attribute is defined as required, it must have a value and the value must not be a null.

Examples

The following example logs a warning if a required attribute has a null value.

if ( (customer.isRequired("Address"))
       && (customerBusObj.isNull("Address")) )
    {
    logWarning(12, "Address is required and cannot be null.");
    }
 else
    {
    // do something else
    }
 

Copyright IBM Corp. 2003, 2004