|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.access.ValidationListTranslatedData
Copyright © 2001, International Business Machines Corporation and others. All Rights Reserved.
The ValidationListTranslatedData class represents language-specific information that is assigned in a standardized format to a validation list entry. This could be information in the non-encrypted data, encrypted data, or identifier portion of a validation list entry. Maximum lengths for each are 1000, 600, and 100 bytes, respectively.
Constructor Summary | |
---|---|
ValidationListTranslatedData()
Constructs a ValidationListTranslatedData. |
|
ValidationListTranslatedData(byte[] buffer,
int offset)
Constructs a ValidationListTranslatedData from a structure stored as server bytes. |
|
ValidationListTranslatedData(int ccsid,
byte[] bytes)
Constructs a ValidationListTranslatedData from the specified server bytes which are encoded in the given ccsid. |
|
ValidationListTranslatedData(String s,
int ccsid,
AS400 as400)
Constructs a ValidationListTranslatedData from the given string. |
Method Summary | |
---|---|
int |
getByteLength()
Returns the total length of the corresponding structure when this object is written to server bytes for use by the validation list APIs. |
byte[] |
getBytes()
Returns the server 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 server bytes. |
protected int |
getReadOffsetTByteLength()
Returns the offset of the length of the translated bytes when the receiver is read from a server byte structure. |
protected int |
getReadOffsetTBytes()
Returns the offset of the translated bytes when the receiver is read from an server byte structure. |
String |
getString(AS400 as400)
Returns the result of converting the assigned server bytes to a Java String using the assigned CCSID. |
protected int |
getWriteNullDataLength()
Returns the length to be specified in the written server 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 server bytes. |
protected int |
getWriteOffsetTByteLength()
Returns the offset of the length of the translated bytes when the receiver is written to an server byte structure. |
protected int |
getWriteOffsetTBytes()
Returns the offset of the translated bytes when the receiver is written to an server byte structure. |
protected boolean |
isValidCcsid(int ccsid)
Indicates whether the given CCSID is valid for tagging server data. |
void |
setBytes(byte[] bytes)
Sets the server bytes comprising the translated data. |
void |
setBytes(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 server APIs. |
int |
toBytes(byte[] buffer,
int offset)
Converts this object to a byte structure usable by the server APIs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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(String s, int ccsid, AS400 as400)
The translated bytes are derived by converting the string to server 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.AS400Method Detail |
public 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 server). 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 String getString(AS400 as400)
The as400 is required to perform the conversion.
as400
- com.ibm.as400.access.AS400
protected 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(String s, int ccsid, AS400 as400)
The translated bytes are derived by converting the string to server 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 server). 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 server bytes are inserted into the buffer starting at the given offset. The total number of bytes inserted is returned.
buffer
- byte[]offset
- int
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |