Methods

Table 73 summarizes the member methods of the BusObjAttr class.

Table 73.

Member methods of the BusObjAttr class
Member method Description Page
BusObjAttr() Creates a business-object-attribute object. BusObjAttr()
getAppText() Retrieves the application-specific information of an attribute. getAppText()
getAttrType() Retrieves the type of a simple attribute. getAttrType()
getAttrTypeName() Retrieves the type of the child business object as the type of an attribute, for an attribute that represents a child business object or an array of child business objects. getAttrTypeName()
getBOVersion() Retrieves the version number of the business object definition, for an attribute that represents a child business object or an array of child business objects. getBOVersion()
getCardinality() Retrieves the cardinality of the attribute, for an attribute that represents a child business object or an array of child business objects. getCardinality()
getComments() Retrieves the comments associated with the attribute. getComments()
getDefault() Retrieves the default value for an attribute. getDefault()
getMaxLength() Retrieves the maximum length for this attribute. getMaxLength()
getName() Retrieves the name of an attribute. getName()
getRelationType() Retrieves the attribute's relationship type, which is containment for an attribute that represents a child business object or an array of child business objects. getRelationType()
isForeignKey() Determines whether this attribute is part of the business object's foreign key. isForeignKey()
isKey() Determines whether this attribute is part of the business object's key. isKey()
isRequiredKey() Determines whether this attribute is part of the business object's required key. isRequiredKey()
isRequiredServerBound() Determines whether an attribute is required when the business object represents a triggering event. isRequiredServerBound()
isSimpleType() Determines whether an attribute is of a simple type (such as String, Integer, or Float) or whether it represents a child business object or an array of child business objects. isSimpleType()
setAppText() Sets the application-specific information of an attribute. setAppText()
setAttrType() Sets the type of the attribute. setAttrType()
setBOVersion() Sets the version of the child business object or objects that is represented by an attribute, for an attribute that represents a child business object or an array of child business objects. setBOVersion()
setCardinality() Sets the cardinality of the attribute, for an attribute that represents a child business object or an array of child business objects. setCardinality()
setComments() Sets the comments associated with the attribute. setComments()
setDefault() Sets the default value for an attribute. setDefault()
setIsForeignKey() Sets the attribute to a boolean value that indicates whether the attribute is part of a foreign key. setIsForeignKey()
setIsKey() Sets the attribute to a boolean value that indicates whether the attribute is part of a key. setIsKey()
setIsRequiredKey() Sets the attribute to a boolean value that indicates whether the attribute is part of the business object's required key. setIsRequiredKey()
setMaxLength() Sets the maximum length for an attribute. setMaxLength()
setName() Sets the name of an attribute. setName()
setRelationType() Sets the relationship type of an attribute to containment, for an attribute that represents a child business object or an array of child business objects. setRelationType()

BusObjAttr()

Creates a new business-object-attribute object.

Syntax

public BusObjAttr(String name, int type);
public BusObjAttr(String name, int type, String typeName);
public BusObjAttr(String name, int type, 
   String typeName, boolean isKey, boolean isForeignKey, 
   boolean isReqd, String appSpecInfo, int maxLen,
   String defaultValue, String BOversion, 
   String cardinality, String relType,
   boolean isReqdServerBound, String comments);

Parameters

appSpecInfo
Specifies the application-specific information for the attribute.

BOversion
Specifies the version of the child business object or objects, for an attribute that represents a child business object or an array of child business objects.

cardinality
Specifies the cardinality of the attribute, for an attribute that represents a child business object or an array of child business objects.

comments
Specifies the optional comments to associate with the attribute.

defaultValue
Specifies a default value for the attribute.

isForeignKey
Specifies whether the attribute is part of the business object's foreign key.

isKey
Specifies whether the attribute is part of the business object's key.

isReqd
Specifies whether a value is required for the attribute.

isReqdServerBound
Specifies whether a value is required for the attribute when the business object represents a triggering event.

maxLen
Specifies the maximum length of the attribute's value.

name
Specifies the name of the attribute.

relType
Specifies that the relationship type is containment, for an attribute that represents a child business object or an array of child business objects.

type
Specifies the type of the attribute.

typeName
Specifies type of the child business object as the type of the attribute, for an attribute that represents a child business object or an array of child business objects.

Return values

The newly instantiated BusObjAttr object.

getAppText()

Retrieves the application-specific information of an attribute.

Syntax

public String getAppText();

Parameters

None.

Return values

A String that contains the application-specific information of an attribute.

See also

setAppText()

getAttrType()

Retrieves the type of an attribute.

Syntax

public int getAttrType();

Parameters

None.

Return values

An integer that represents the type of the attribute. Compare this integer value with the one of the attribute-type constants:

BusObjAttrType.BOOLEAN
The attribute has the Boolean data type.

BusObjAttrType.CIPHERTEXT
The attribute has the Cipher Text data type.

BusObjAttrType.DATE
The attribute has the Date data type.

BusObjAttrType.DOUBLE
The attribute has the Double data type.

BusObjAttrType.FLOAT
The attribute has the Float data type.

BusObjAttrType.INTEGER
The attribute has the Integer data type.

BusObjAttrType.INVALID_TYPE
The attribute has an invalid data type.

BusObjAttrType.LONGTEXT
The attribute has the Long Text data type.

BusObjAttrType.OBJECT
The attribute has the Object data type (it contains another business object).

BusObjAttrType.STRING
The attribute has the String data type.

See also

getAttrTypeName(), setAttrType()

getAttrTypeName()

Retrieves the name of the attribute's data type.

Syntax

public String getAttrTypeName();

Parameters

None.

Return values

A String that contains the name of the business object definition that is the type of the child business object (when the attribute contains a child business object).

Notes

The getAttrTypeName() method retrieves the name of the attribute type for a child business object. When an attribute represents a child business object (or an array of child business objects), its attribute type isBusObjAttrType.OBJECT and its attribute type name is the name of the business object definition for the child business object.

See also

getAttrType(), setAttrType()

getBOVersion()

Retrieves the version number of the business object definition, for an attribute that represents a child business object or an array of child business objects.

Syntax

public String getBOVersion();

Parameters

None.

Return values

A String that contains the version number of the child business object definition represented by the attribute.

See also

setBOVersion()

getCardinality()

Retrieves the cardinality of the attribute, for an attribute that represents a child business object or an array of child business objects.

Syntax

public String getCardinality();

Parameters

None.

Return values

A String that contains the cardinality of an attribute that represents a child business object or array of child business objects. Compare this string value with the following cardinality constants:

BusObjAttr.CARD_SINGLE
The attribute has single cardinality.

BusObjAttr.CARD_MULTIPLE
The attribute has multiple cardinality.

See also

setCardinality()

getComments()

Retrieves the comments associated with the attribute.

Syntax

public String getComments();

Parameters

None.

Return values

A String that contains the comments for an attribute.

getDefault()

Retrieves the default value for an attribute.

Syntax

public String getDefault();

Parameters

None.

Return values

A String that contains the default value for an attribute.

See also

setDefault()

getMaxLength()

Retrieves the maximum length for this attribute.

Syntax

public int getMaxLength();

Parameters

None.

Return values

An integer that represents the maximum length of an attribute's value.

See also

setMaxLength()

getName()

Retrieves the name of an attribute.

Syntax

public String getName();

Parameters

None.

Return values

A String that contains the name of an attribute.

See also

setName()

getRelationType()

Retrieves the attribute's relationship type, which is containment for an attribute that represents a child business object or an array of child business objects.

Syntax

public String getRelationType();

Parameters

None.

Return values

A String that contains the relationship type ("containment") of an attribute that represents a child business object or an array of child business objects.

See also

setRelationType()

isForeignKey()

Determines whether this attribute is part of the business object's foreign key.

Syntax

public boolean isForeignKey();

Parameters

None.

Return values

Returns true, if the attribute is a foreign key or part of the foreign key; otherwise, returns false.

See also

setIsForeignKey()

isKey()

Determines whether this attribute is part of the business object's primary key.

Syntax

public boolean isKey();

Parameters

None.

Return values

Returns true, if the attribute is a key or part of the key; otherwise, returns false.

See also

setIsKey()

isRequiredKey()

Determines whether this attribute is part of the business object's required key.

Syntax

public boolean isRequiredKey();

Parameters

None.

Return values

Returns true, if the attribute is a required key or part of a required key; otherwise, returns false.

See also

setIsRequiredKey()

isRequiredServerBound()

Determines whether an attribute is required when the business object represents a triggering event.

Syntax

public boolean isRequiredServerBound();

Parameters

None.

Return values

Returns true, if the attribute is required when the business object represents a collaboration object request; otherwise, returns false.

isSimpleType()

Determines whether an attribute is of a simple type (such as String, Integer, or Float) or whether it represents a child business object or an array of child business objects.

Syntax

public boolean isSimpleType();

Parameters

None.

Return values

Returns true, if the attribute is of a simple type; otherwise, returns false.

See also

getAttrType(), setAttrType()

setAppText()

Sets the application-specific information of an attribute.

Syntax

public void setAppText(String appInfo);

Parameters

appInfo
Is the application-specific information to assign to the attribute.

Return values

None.

See also

getAppText()

setAttrType()

Sets the type of the attribute.

Syntax

public void setAttrType(int type);
public void setAttrType(int type, String typeName);

Parameters

type
Is the type of the attribute, represented as one of the attribute-type constants:
BusObjAttrType.BOOLEAN

 
BusObjAttrType.CIPHERTEXT

 
BusObjAttrType.DATE

 
BusObjAttrType.DOUBLE

 
BusObjAttrType.FLOAT

 
BusObjAttrType.INTEGER

 
BusObjAttrType.LONGTEXT

 
BusObjAttrType.OBJECT

 
BusObjAttrType.STRING

typeName
Is the name of the business object for an attribute that represents a child business object or array of child business objects; in this case, the type of the attribute is the same as the type of the child business object and the type value is OBJECT.

Return values

None.

Exceptions

BusObjInvalidAttrException

Thrown if the type is invalid; that is, it is not one of the values represented by the attribute-type constants.

Notes

The setAttrType() method provides the following forms:

See also

getAttrType(), getAttrTypeName()

For related reference information, see BusObjAttrType interface and ODKException class.

setBOVersion()

Sets the version number of the business object definition, for an attribute that represents a child business object or an array of child business objects.

Syntax

public void setBOVersion(String version);

Parameters

version
Is the version of the business object definition for the child business object or objects that this attribute represents.

Return values

None.

See also

getBOVersion()

setCardinality()

Sets the cardinality of the attribute, for an attribute that represents a child business object or an array of child business objects.

Syntax

public void setCardinality(String cardinality);

Parameters

cardinality
Is the cardinality to assign to this attribute. Cardinality is represented by one of the following cardinality constants:
BusObjAttr.CARD_SINGLE

 
BusObjAttr.CARD_MULTIPLE

Return values

None.

Exceptions

BusObjInvalidAttrException

Thrown if the cardinality is not a valid; that is, it does not contain a valid cardinality constant.

See also

getCardinality()

setComments()

Sets the comments associated with an attribute.

Syntax

public void setComments(String comment);

Parameters

comment
Is the comment string to provide additional information for the attribute.

Return values

None.

See also

getComments()

setDefault()

Sets the default value for an attribute.

Syntax

public void setDefault(String defaultValue);

Parameters

defaultValue
Is the default value to assign to the attribute.

Return values

None.

See also

getDefault()

setIsForeignKey()

Sets the attribute property that indicates whether the attribute is part of a foreign key.

Syntax

public void setIsForeignKey(boolean fKey);

Parameters

fKey
Indicates whether this attribute is part of a foreign key.

Return values

None.

See also

isForeignKey()

setIsKey()

Sets an attribute property that indicates whether the attribute is part of a primary key.

Syntax

public void setIsKey(boolean key);

Parameters

key
Indicates whether this attribute is part of a key.

Return values

None.

See also

isKey()

setIsRequiredKey()

Sets the attribute to a boolean value that indicates whether the attribute is part of the business object's required key.

Syntax

public void setIsRequiredKey(boolean isReqd);

Parameters

isReqd
Indicates whether this attribute is a required key.

Return values

None.

See also

isRequiredKey()

setMaxLength()

Sets the maximum length for an attribute.

Syntax

public void setMaxLength(int maxLength);

Parameters

maxLength
Is the maximum length to assign to the attribute.

Return values

None.

Exceptions

BusObjInvalidAttrException

Thrown if the maximum length is maxLength < 0 or maxLength > 2^31-1

See also

getMaxLength()

setName()

Sets the name of an attribute.

Syntax

public void setName(String name);

Parameters

name
Is the name to assign to the attribute.

Return values

None.

See also

getName()

setRelationType()

Sets the relationship type of an attribute to containment, for an attribute that represents a child business object or an array of child business objects.

Syntax

public void setRelationType(String relType);

Parameters

relType
Is the relationship type to assign to this attribute.

Return values

None.

See also

getRelationType()

Copyright IBM Corp. 1997, 2004