com.ibm.etools.sfm.sfpi
Interface SFMessage


public interface SFMessage

SFMessage represents a structured data message to be used as the input or output for an operation. This interface includes methods that allow easy addition of simple elements to the message. These methods do not provide support for adding complex structures to a message. To create complex structures, use the Eclipse XSD model to build up an XSDSchema, and use the SFMessageFile.setSchema() method.


Method Summary
 void addFloatingPointElement(java.lang.String name, boolean signed, int totalDigits, int fractionDigits, java.lang.Double defaultValue)
          Adds a simple floating point element to the message.
NOTE: This is equivalent to addFloatingPointElement(name, signed, totalDigits, fractionDigits, 1).
 void addFloatingPointElement(java.lang.String name, boolean signed, int totalDigits, int fractionDigits, java.lang.Double defaultValue, int occurs)
          Adds a simple floating point element to the message.
 void addIntegerElement(java.lang.String name, boolean signed, int min, int max, java.lang.Integer defaultValue)
          Adds a simple integer element to the message.
NOTE: This is equivalent to addIntegerElement(name, signed, min, max, 1).
 void addIntegerElement(java.lang.String name, boolean signed, int min, int max, java.lang.Integer defaultValue, int occurs)
          Adds a simple integer element to the message.
 void addStringElement(java.lang.String name, int maxLength, java.lang.String defaultValue)
          Adds a simple string element to the message.
NOTE: This is equivalent to addStringElement(name, maxLength, 1).
 void addStringElement(java.lang.String name, int maxLength, java.lang.String defaultValue, int occurs)
          Adds a simple string element to the message.
 org.eclipse.xsd.XSDElementDeclaration getElementDeclaration()
           
 java.lang.String getName()
           
 void setName(java.lang.String name)
          Sets the name of the message.
 

Method Detail

getName

java.lang.String getName()
Returns:
The name of the message.

setName

void setName(java.lang.String name)
             throws SFException
Sets the name of the message.

Parameters:
name - The name of the message.
Throws:
SFException - In case the supplied name is not valid, one of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1104E_MESSAGENAMECONFLICT The message file contains at least two messages with the same name. (Applies only if the message is associated with a message file.) ERROR: The name was not set successfully.

addStringElement

void addStringElement(java.lang.String name,
                      int maxLength,
                      java.lang.String defaultValue)
                      throws SFException
Adds a simple string element to the message.
NOTE: This is equivalent to addStringElement(name, maxLength, 1).

Parameters:
name - The name of the string element.
maxLength - The maximum length of the string element.
defaultValue - The default value of the element. If null, no default value is specified.
Throws:
SFException - One of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null or the maxLength is less than or equal to zero. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1102E_NAMEALREADYINUSE The message or element name is already in use.

addStringElement

void addStringElement(java.lang.String name,
                      int maxLength,
                      java.lang.String defaultValue,
                      int occurs)
                      throws SFException
Adds a simple string element to the message.

Parameters:
name - The name of the string element.
maxLength - The maximum length of the string element.
defaultValue - The default value of the element. If null, no default value is specified.
occurs - The number of times this element occurs.
Throws:
SFException - One of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null, the maxLength is less than or equal to zero, or occurs is less than one. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1102E_NAMEALREADYINUSE The message or element name is already in use.

addIntegerElement

void addIntegerElement(java.lang.String name,
                       boolean signed,
                       int min,
                       int max,
                       java.lang.Integer defaultValue)
                       throws SFException
Adds a simple integer element to the message.
NOTE: This is equivalent to addIntegerElement(name, signed, min, max, 1).

Parameters:
name - The name of the integer element.
signed - Whether the integer element is signed.
min - The minimum value of the integer element.
max - The maximum value of the integer element.
defaultValue - The default value of the element. If null, no default value is specified.
Throws:
SFException - One of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null or the minimum is greater than the maximum. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1102E_NAMEALREADYINUSE The message or element name is already in use.

addIntegerElement

void addIntegerElement(java.lang.String name,
                       boolean signed,
                       int min,
                       int max,
                       java.lang.Integer defaultValue,
                       int occurs)
                       throws SFException
Adds a simple integer element to the message.

Parameters:
name - The name of the integer element.
signed - Whether the integer element is signed.
min - The minimum value of the integer element.
max - The maximum value of the integer element.
defaultValue - The default value of the element. If null, no default value is specified.
occurs - The number of times this element occurs.
Throws:
SFException - One of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null, the minimum is greater than the maximum, or occurs is less than one. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1102E_NAMEALREADYINUSE The message or element name is already in use.

addFloatingPointElement

void addFloatingPointElement(java.lang.String name,
                             boolean signed,
                             int totalDigits,
                             int fractionDigits,
                             java.lang.Double defaultValue)
                             throws SFException
Adds a simple floating point element to the message.
NOTE: This is equivalent to addFloatingPointElement(name, signed, totalDigits, fractionDigits, 1).

Parameters:
name - The name of the floating point element.
signed - Whether the floating point element is signed.
totalDigits - The sum of the number of digits before and after the decimal point.
fractionDigits - The number of digits after the decimal point. Must be less than or equal to totalDigits.
defaultValue - The default value of the element. If null, no default value is specified.
Throws:
SFException - One of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null, the fractionDigits is greater than the totalDigits, the fractionDigits is greater than 18, the fractionDigits is less than zero, or the totalDigits is less than zero. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1102E_NAMEALREADYINUSE The message or element name is already in use.

addFloatingPointElement

void addFloatingPointElement(java.lang.String name,
                             boolean signed,
                             int totalDigits,
                             int fractionDigits,
                             java.lang.Double defaultValue,
                             int occurs)
                             throws SFException
Adds a simple floating point element to the message.

Parameters:
name - The name of the floating point element.
signed - Whether the floating point element is signed.
totalDigits - The sum of the number of digits before and after the decimal point.
fractionDigits - The number of digits after the decimal point. Must be less than or equal to totalDigits.
defaultValue - The default value of the element. If null, no default value is specified.
occurs - The number of times this element occurs.
Throws:
SFException - One of the following exceptions may result:
Error Description Severity
WZEF1001E_ARGSERROR Illegal arguments. The name is null, the fractionDigits is greater than the totalDigits, the fractionDigits is greater than 18, the fractionDigits is less than zero, the totalDigits is less than zero, or occurs is les than one. ERROR: The name was not set successfully.
WZEF1100E_NAMENOTVALID The message or element name is not valid. A message or element name must not contain spaces or the colon (':') character. A message or element name must begin with either a letter or an underscore ('_') character. ERROR: The name was not set successfully.
WZEF1101W_COBOLNAMENOTVALID The message name is not a valid COBOL variable name. Either the name is illegal in COBOL or it matches a COBOL reserved word. WARNING: The name was set successfully.
WZEF1102E_NAMEALREADYINUSE The message or element name is already in use.

getElementDeclaration

org.eclipse.xsd.XSDElementDeclaration getElementDeclaration()
Returns:
The XML Schema element declaration that corresponds to this SFMessage. If the message has not yet been added to a message file, this method returns null.