//To make the below code a bit more consice...START
boolean bNullOk = getPARInt().getPARDupNullLen().isNullOk();
RCLength rclArray = getPARInt().getPARDupNullLen().getRCLength();
boolean bDupsOk = getPARInt().getPARDupNullLen().areDupsOk();
boolean bOrdered = getPARInt().getPAROrderDir().isOrdered();
RangeConfig rcLmnt = getPARInt().getPARIElement().getRangeConfig();
boolean bAXIfBad = (s_callingClsFnc != null || s_varName != null);
//To make the below code a bit more consice...END
if(!bNullOk) {
if(isNull()) {
setPAViolation(new PAViolation(PAViolation.getType_NULL()));
if(bAXIfBad) {
throwAXIllegal(s_callingClsFnc, s_varName, "isNull() equals true.");
}
return false;
}
} else if(isNull()) {
//A null array cannot be analyzed further.
declareNoViolation();
return true;
}
//The array is not null.
if(!rclArray.isValid(getLength())) {
setPAViolation(new PAViolation(PAViolation.getType_LENGTH()));
if(bAXIfBad) {
throwAXIllegal(s_callingClsFnc, s_varName, "the number of elements in the array (" + getLength() + ") is illegal according to getPARInt().getArrayRCL().isValid().");
}
return false;
} else if(getLength() < 1) {
//The array is zero elements in length, and this is okay.
//An empty array can, but does not need to be analyzed further.
declareNoViolation();
return true;
}
//The string array has at least one element.
final String sLMNT = "element ";
for(int i = 0; i < getLength(); i++) {
if(!rcLmnt.isValid(getInt(i))) {
setPAViolation(new PAViolation(PAViolation.getType_ILMNT_OOBOUNDS(), i));
if(bAXIfBad) {
throwAXIllegal(s_callingClsFnc, s_varName, sLMNT + i + " ('" + getInt(i) + "') is illegal according to getPARInt().getRCLength().isValid().");
}
return false;