BOM Class Instance Methods

The methods listed in the table BOM Class Instance Methods are available on each instance of a BOM JavaScript class.

BOM Class Instance Methods

Method Return Value Description
getAttributeValue (attName)
  • attName: name of attribute.
Object Returns the value of the attribute with the given name. The return type depends on the type of attribute being retrieved. It will be one of the following:
  • attName is primitive and single-valued: returns a value of type String, Number, Date, or Duration, depending on the specific type of attribute.
  • attName is primitive and multi-valued: returns a JavaScript array containing the underlying values.
  • attName is complex and single-valued: returns an instance of the BOM JavaScript class associated with the attribute.
  • attName is complex and multi-valued: returns a List object containing the underlying values.

    The method throws an exception if the underlying class does not support an attribute with the given name.

setAttributeValue (attName, value)
  • attName: name of attribute.
  • value: new value of attribute.
Void Sets the value associated with the given attribute name. The type of object depends on the attribute being set:
  • attName is primitive and single-valued: should be a value of type String, Number, Date, or Duration, depending on the specific type of attribute.
  • attName is primitive and multi-valued: should be a JavaScript array containing the underlying values.
  • attName is complex and single-valued: should be an instance of the BOM JavaScript class associated with the attribute.
  • attName is complex and multi-valued: unsupported. In this case, the List object obtained from the object should be updated directly with additions or deletions.

    The method throws an exception in the following scenarios:

  • if the underlying class does not support an attribute with the given name.
  • if an attempt is made to set the value of a complex multi-valued attribute.