_attributes.addAttribute(name, buffer.toString());
}
} else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START && _algorithmHandler != null) {
final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
if (URI == null) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
}
final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
if (ea != null) {
final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
_attributes.addAttributeWithAlgorithmData(name, URI, _identifier, data);
} else {
final byte[] data = new byte[_octetBufferLength];
System.arraycopy(_octetBuffer, _octetBufferStart, data, 0, _octetBufferLength);
_attributes.addAttributeWithAlgorithmData(name, URI, _identifier, data);
}
} else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
// TODO should have property to ignore
throw new EncodingAlgorithmException(
CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
} else if (_identifier == EncodingAlgorithmIndexes.CDATA) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));
} else {
// Reserved built-in algorithms for future use
// TODO should use sax property to decide if event will be
// reported, allows for support through handler if required.
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
}
if (addToTable) {
_attributeValueTable.add(_attributes.getValue(_attributes.getIndex(name.qName)));
}