TibrvMsgView.getField()

Method

Declaration

TibrvMsgField getField(
    java.lang.String  fieldName)
  throws TibrvException
TibrvMsgField getField(
    int               fieldId)
  throws TibrvException
TibrvMsgField getField(
    java.lang.String  fieldName,
    int               fieldId)
  throws TibrvException

Purpose

Get a specified field from a snapshot message view.

Remarks

Programs specify the field to retrieve using the fieldName and fieldId parameters.

The method TibrvMsgView.extract() creates field objects for each field of the message snapshot. This returns one of those field objects.

Programs can use a related method to loop through all the fields of a message view; to retrieve each field by its integer index number, see TibrvMsgView.getFieldByIndex().

Parameter

Description

fieldName

Get a field with this name.

fieldId

Get the field with this identifier.

Method Forms

With only a field name, find the field by name. If the field name is not present in the message, return null. If several fields with that name are present in the message, this method returns the first one that it finds.

With only a field identifier, find the field with that identifier (since identifiers are unique, the message can contain at most one such field). If the identifier is not present in the message, return null.

With both a field name and a field identifier, search first by identifier, and then by field name. If neither are present in the message, return null.

See Also

TibrvMsgView

TibrvMsgView.get()