case DecoderStateTables.AII_TERMINATOR_SINGLE:
terminate = true;
// AIIs have finished break out of loop
continue;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingAIIs"));
}
// [normalized value] of AII
if (name.prefixIndex > 0 && _prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.AIIqNameNotInScope"));
}
_duplicateAttributeVerifier.checkForDuplicateAttribute(name.attributeHash, name.attributeId);
b = read();
switch(DecoderStateTables.NISTRING(b)) {
case DecoderStateTables.NISTRING_UTF8_SMALL_LENGTH:
_octetBufferLength = (b & EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK) + 1;
value = decodeUtf8StringAsString();
if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
case DecoderStateTables.NISTRING_UTF8_MEDIUM_LENGTH:
_octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_LIMIT;
value = decodeUtf8StringAsString();
if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
case DecoderStateTables.NISTRING_UTF8_LARGE_LENGTH:
_octetBufferLength = ((read() << 24) |
(read() << 16) |
(read() << 8) |
read())
+ EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
value = decodeUtf8StringAsString();
if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
case DecoderStateTables.NISTRING_UTF16_SMALL_LENGTH:
_octetBufferLength = (b & EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK) + 1;
value = decodeUtf16StringAsString();
if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
case DecoderStateTables.NISTRING_UTF16_MEDIUM_LENGTH:
_octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_LIMIT;
value = decodeUtf16StringAsString();
if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
case DecoderStateTables.NISTRING_UTF16_LARGE_LENGTH:
_octetBufferLength = ((read() << 24) |
(read() << 16) |
(read() << 8) |
read())
+ EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
value = decodeUtf16StringAsString();
if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
case DecoderStateTables.NISTRING_RA:
{
final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
// Decode resitricted alphabet integer
_identifier = (b & 0x0F) << 4;
b = read();
_identifier |= (b & 0xF0) >> 4;
decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
value = decodeRestrictedAlphabetAsString();
if (addToTable) {
_attributeValueTable.add(value);
}
_attributes.addAttribute(name, value);
break;
}
case DecoderStateTables.NISTRING_EA:
{
final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
// Decode encoding algorithm integer
_identifier = (b & 0x0F) << 4;
b = read();
_identifier |= (b & 0xF0) >> 4;
decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
processAIIEncodingAlgorithm(name, addToTable);
break;
}
case DecoderStateTables.NISTRING_INDEX_SMALL:
_attributes.addAttribute(name,
_attributeValueTable._array[b & EncodingConstants.INTEGER_2ND_BIT_SMALL_MASK]);
break;
case DecoderStateTables.NISTRING_INDEX_MEDIUM:
{
final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
+ EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
_attributes.addAttribute(name,
_attributeValueTable._array[index]);
break;
}
case DecoderStateTables.NISTRING_INDEX_LARGE:
{
final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
+ EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
_attributes.addAttribute(name,
_attributeValueTable._array[index]);
break;
}
case DecoderStateTables.NISTRING_EMPTY:
_attributes.addAttribute(name, "");
break;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingAIIValue"));
}
} while (!terminate);
// Reset duplication attribute verfifier