if (fmi == null)
fmi = new Attributes();
attrs = fmi;
}
if (next() != Event.START_OBJECT) {
throw new JsonParsingException("Unexpected " + event
+ " expected attribute object", location);
}
if (next() != Event.KEY_NAME) {
throw new JsonParsingException("Unexpected " + event
+ "\", expected \"vr\"", location);
}
key = getString();
if (!"vr".equals(key)) {
throw new JsonParsingException("Unexpected \"" + key
+ "\", expected: \"vr\"", location);
}
if (next() != Event.VALUE_STRING) {
throw new JsonParsingException("Unexpected " + event
+ " expected vr value", location);
}
VR vr = VR.valueOf(parser.getString());
switch (next()) {
case END_OBJECT:
attrs.setNull(tag, vr);
break;
case KEY_NAME:
key = getString();
if ("Value".equals(key)) {
switch (vr) {
case AE:
case AS:
case AT:
case CS:
case DA:
case DT:
case LO:
case LT:
case SH:
case ST:
case TM:
case UI:
case UT:
readStringValues(attrs, tag, vr);
break;
case DS:
case FL:
case FD:
case IS:
case SL:
case SS:
case UL:
case US:
readNumberValues(attrs, tag, vr);
break;
case PN:
readPersonNames(attrs, tag);
break;
case SQ:
readSequence(attrs, tag);
break;
case OB:
case OF:
case OW:
case UN:
throw new JsonParsingException("Unexpected \"Value\""
+ "\", expected \"InlineBinary\""
+ " or \"BulkDataURI\" or \"DataFragment\"", location);
}
} else if ("InlineBinary".equals(key)) {
attrs.setBytes(tag, vr, readInlineBinary());
} else if ("BulkDataURI".equals(key)) {
attrs.setValue(tag, vr, readBulkData(attrs.bigEndian()));
} else if ("DataFragment".equals(key)) {
readDataFragment(attrs, tag, vr);
} else {
throw new JsonParsingException("Unexpected \"" + key
+ "\", expected \"Value\" or \"InlineBinary\""
+ " or \"BulkDataURI\" or \"DataFragment\"", location);
}
if (next() != Event.END_OBJECT) {
throw new JsonParsingException("Unexpected " + event
+ " expected end of attribute object", location);
}
break;
default:
throw new JsonParsingException("Unexpected " + event
+ "\", expected \"Value\" or \"InlineBinary\""
+ " or \"BulkDataURI\"", location);
}
}