public class ValidationListTranslatedData
extends java.lang.Object
Constructor and Description |
---|
ValidationListTranslatedData()
Constructs a ValidationListTranslatedData.
|
ValidationListTranslatedData(byte[] buffer,
int offset)
Constructs a ValidationListTranslatedData from a structure stored as IBM i bytes.
|
ValidationListTranslatedData(int ccsid,
byte[] bytes)
Constructs a ValidationListTranslatedData from the specified IBM i bytes
which are encoded in the given ccsid.
|
ValidationListTranslatedData(java.lang.String s,
int ccsid,
AS400 as400)
Constructs a ValidationListTranslatedData from the given string.
|
Modifier and Type | Method and Description |
---|---|
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.
|
byte[] |
getBytes()
Returns the IBM i bytes comprising the translated data.
|
int |
getCcsid()
Returns the coded character set identifier used to encode the translated bytes.
|
protected int |
getReadOffsetCcsid()
Returns the offset of CCSID information in the structure when the receiver is
read from IBM i bytes.
|
protected int |
getReadOffsetTByteLength()
Returns the offset of the length of the translated bytes when the receiver
is read from a IBM i byte structure.
|
protected int |
getReadOffsetTBytes()
Returns the offset of the translated bytes when the receiver is read from an
IBM i byte structure.
|
java.lang.String |
getString(AS400 as400)
Returns the result of converting the assigned IBM i bytes to a Java String
using the assigned CCSID.
|
protected int |
getWriteNullDataLength()
Returns the length to be specified in the written IBM i byte structure
if the assigned data is null.
|
protected int |
getWriteOffsetCcsid()
Returns the offset of CCSID information in the structure when the receiver
is written to IBM i bytes.
|
protected int |
getWriteOffsetTByteLength()
Returns the offset of the length of the translated bytes when the receiver
is written to an IBM i byte structure.
|
protected int |
getWriteOffsetTBytes()
Returns the offset of the translated bytes when the receiver is written to an
IBM i byte structure.
|
protected boolean |
isValidCcsid(int ccsid)
Indicates whether the given CCSID is valid for tagging IBM i data.
|
void |
setBytes(byte[] bytes)
Sets the IBM i bytes comprising the translated data.
|
void |
setBytes(java.lang.String s,
int ccsid,
AS400 as400)
Sets the bytes comprising the translated data from the given string.
|
void |
setCcsid(int ccsid)
Sets the coded character set identifier used to encode the translated bytes.
|
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 byte structure usable by the system APIs.
|
public ValidationListTranslatedData()
public ValidationListTranslatedData(byte[] buffer, int offset)
The offset indicates the starting position of the structure in the given buffer.
buffer
- byte[]offset
- intpublic ValidationListTranslatedData(int ccsid, byte[] bytes)
ccsid
- intbytes
- byte[]public ValidationListTranslatedData(java.lang.String s, int ccsid, AS400 as400)
The translated bytes are derived by converting the string to IBM i bytes using the given ccsid. The as400 is required to perform the conversion from text to bytes. A ccsid of 0 indicates to use the ccsid of the current user.
s
- java.lang.Stringccsid
- intas400
- com.ibm.as400.access.AS400public int getByteLength()
This is the length of the entire structure, not just the translated bytes.
public byte[] getBytes()
For text conversion, the bytes will be interpreted using the assigned ccsid.
public int getCcsid()
Valid CCSID values are in the range 1 through 65535. The special value 0 can be used to indicate the default CCSID for the current user (when the validation list APIs are invoked on the system). In some cases, primarily attribute data, the special value -1 is also allowed. This indicates that no CCSID value is stored with the data (i.e. binary data, where no conversion is required).
protected int getReadOffsetCcsid()
protected int getReadOffsetTByteLength()
protected int getReadOffsetTBytes()
public java.lang.String getString(AS400 as400)
The as400 is required to perform the conversion.
as400
- com.ibm.as400.access.AS400protected int getWriteNullDataLength()
Typically this value is set to 0. However, there are some cases where other values must be specified to maintain proper behavior. For example, when changing an entry a structure must be specified for the data to encrypt, even if the encrypted data should not be changed. However, if the data length in the structure is set to 0 instead of -1, the existing encrypted data is wiped out. This is undesirable since we don't always want the encrypted data changed. We might want to modify the unencrypted data (i.e. user statistics) while leaving the encrypted data (i.e. user password) unchanged.
protected int getWriteOffsetCcsid()
protected int getWriteOffsetTByteLength()
protected int getWriteOffsetTBytes()
protected boolean isValidCcsid(int ccsid)
public void setBytes(byte[] bytes)
For text conversion, the bytes will be interpreted using the assigned ccsid.
bytes
- byte[]public void setBytes(java.lang.String s, int ccsid, AS400 as400)
The translated bytes are derived by converting the string to IBM i bytes using the given ccsid. The as400 is required to perform the conversion from text to bytes. A ccsid of 0 indicates to use the ccsid of the current user.
s
- java.lang.Stringccsid
- intas400
- com.ibm.as400.access.AS400public void setCcsid(int ccsid)
Valid CCSID values are in the range 1 through 65535. The special value 0 can be used to indicate the default CCSID for the current user (when the validation list APIs are invoked on the system). In some cases, primarily attribute data, the special value -1 is also allowed. This indicates that no CCSID value is stored with the data (i.e. binary data, where no conversion is required).
ccsid
- intpublic byte[] toBytes()
public int toBytes(byte[] buffer, int offset)
The IBM i bytes are inserted into the buffer starting at the given offset. The total number of bytes inserted is returned.
buffer
- byte[]offset
- int