com.ibm.as400.access
Class ValidationListAttribute

java.lang.Object
  extended by com.ibm.as400.access.ValidationListAttribute

public class ValidationListAttribute
extends Object

Represents an attribute assigned to an entry in a validation list. Each validation list entry may contain one or more attributes. For each attribute, there is an associated value.

Author:
Thomas Johnson (tom.johnson@kingland.com), Kingland Systems Corporation

Constructor Summary
Constructor and Description
ValidationListAttribute()
          Constructs a validation list attribute.
ValidationListAttribute(AS400 as400)
          Constructs a validation list attribute.
 
Method Summary
Modifier and Type Method and Description
 AS400 getAS400()
          Returns the system assigned to the attribute.
 int getByteLength()
          Returns the total length of the corresponding structure when this object is written to IBM i bytes for use by the validation list APIs.
 ValidationListAttributeData getData()
          Returns the data associated with the attribute.
 String getIdentifier()
          Returns the identifier of the attribute.
 int getLocation()
          Indicates where the attribute should be stored.
 int getMaximumValueLength()
          Returns the maximum length of the value associated with the attribute.
 int getType()
          Returns the attribute type.
 void setAS400(AS400 as400)
          Sets the system assigned to the attribute.
 void setData(ValidationListAttributeData data)
          Sets the data associated with the attribute.
 void setIdentifier(String s)
          Sets the identifier of the attribute.
 void setLocation(int location)
          Indicates where the attribute should be stored.
 void setMaximumValueLength(int length)
          Sets the maximum length of the value associated with the attribute.
 void setType(int type)
          Returns the attribute type.
 byte[] toBytes()
          Returns the byte array resulting from converting this object to a structure usable by the system APIs.
 int toBytes(byte[] buffer, int offset)
          Converts this object to a structure usable by the system APIs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationListAttribute

public ValidationListAttribute()
Constructs a validation list attribute.


ValidationListAttribute

public ValidationListAttribute(AS400 as400)
Constructs a validation list attribute.

The as400 is used to translate the assigned identifier when converted to IBM i bytes.

Parameters:
as400 - com.ibm.as400.access.AS400
Method Detail

getAS400

public AS400 getAS400()
Returns the system assigned to the attribute.

Used to translate the assigned identifier when converted to IBM i bytes.

Returns:
com.ibm.as400.access.AS400

getByteLength

public int getByteLength()
Returns the total length of the corresponding structure when this object is written to IBM i bytes for use by the validation list APIs.

The size varies based on usage of the receiver. If there is no associated data, it is assumed that the structure being written is to identify an attribute to be retrieved (eg. find an entry). If there is associated data, it is assumed the structure will be used when adding a new entry or changing an existing entry.

Returns:
int

getData

public ValidationListAttributeData getData()
Returns the data associated with the attribute.

This value is required when the attribute is referenced to add a new entry or change an existing entry. It should not be set when the attribute is used to identify values to retrieve (eg. when finding an entry).

Returns:
ValidationListAttributeData

getIdentifier

public String getIdentifier()
Returns the identifier of the attribute.

For system-defined attributes, the allowed values are:

Returns:
java.lang.String

getLocation

public int getLocation()
Indicates where the attribute should be stored. The allowed values are:

Returns:
int

getMaximumValueLength

public int getMaximumValueLength()
Returns the maximum length of the value associated with the attribute.

This value is referenced when invoking APIs that need to indicate a length for the buffer used to retrieve the attribute value.

Returns:
int

getType

public int getType()
Returns the attribute type. The allowed values are:

Returns:
int

setAS400

public void setAS400(AS400 as400)
Sets the system assigned to the attribute.

Used to translate the assigned identifier when converted to IBM i bytes.

Parameters:
as400 - com.ibm.as400.access.AS400

setData

public void setData(ValidationListAttributeData data)
Sets the data associated with the attribute.

This value is required when the attribute is referenced to add a new entry or change an existing entry. It should not be set when the attribute is used to identify values to retrieve (eg. when finding an entry).

Parameters:
data - ValidationListAttributeData

setIdentifier

public void setIdentifier(String s)
Sets the identifier of the attribute.

For system-defined attributes, the allowed values are:

Parameters:
s - java.lang.String

setLocation

public void setLocation(int location)
Indicates where the attribute should be stored. The allowed values are:

Parameters:
location - int

setMaximumValueLength

public void setMaximumValueLength(int length)
Sets the maximum length of the value associated with the attribute.

This value is referenced when invoking APIs that need to indicate a length for the buffer used to retrieve the attribute value.

Parameters:
length - int

setType

public void setType(int type)
Returns the attribute type. The allowed values are:

Parameters:
type - int

toBytes

public byte[] toBytes()
Returns the byte array resulting from converting this object to a structure usable by the system APIs.

Returns:
byte[]

toBytes

public int toBytes(byte[] buffer,
                   int offset)
Converts this object to a structure usable by the system APIs.

The IBM i bytes are inserted into the buffer starting at the given offset. The total number of bytes inserted is returned.

Parameters:
buffer - byte[]
offset - int
Returns:
int