makeNewAttrObject()

Creates a new business object of the correct type for the attribute.

Syntax

public Object makeNewAttrObject(int position);
public Object makeNewAttrObject(String name);

Parameters

name
Is the name of an attribute.

position
Is an integer that specifies the ordinal position of an attribute in the business object's attribute list.

Return values

An Object containing the newly created instance of the attribute class.

Exceptions

CxObjectNoSuchAttributeException
Thrown if the position or name specified is not valid for the definition of this business object.

Notes

The makeNewAttrObject() method creates a new business object of the correct type for the attribute with the specified name or at the specified position in the attribute list. For example, for an attribute of type container, the method returns an instance of a CxObjectContainerInterface.

The caller needs to cast the returned object to the correct type. In the case where the type is a business object, the caller must cast the returned object to BusinessObjectInterface. For an attribute whose value is a container, cast the returned object to CxObjectContainerInterface.

This method should typically be used with attributes that contain child objects.

Copyright IBM Corp. 1997, 2004