in xstream/src/java/com/thoughtworks/xstream/XStream.java [2107:2150]
public ObjectInputStream createObjectInputStream(final HierarchicalStreamReader reader, DataHolder dataHolder)
throws IOException {
if (collectionUpdateLimit > 0) {
if (dataHolder == null) {
dataHolder = new MapBackedDataHolder();
}
dataHolder.put(COLLECTION_UPDATE_LIMIT, Integer.valueOf(collectionUpdateLimit));
dataHolder.put(COLLECTION_UPDATE_SECONDS, Integer.valueOf(0));
}
final DataHolder dh = dataHolder;
return new CustomObjectInputStream(new CustomObjectInputStream.StreamCallback() {
@Override
public Object readFromStream() throws EOFException {
if (!reader.hasMoreChildren()) {
throw new EOFException();
}
reader.moveDown();
final Object result = unmarshal(reader, null, dh);
reader.moveUp();
return result;
}
@Override
public Map<String, Object> readFieldsFromStream() throws IOException {
throw new NotActiveException("not in call to readObject");
}
@Override
public void defaultReadObject() throws NotActiveException {
throw new NotActiveException("not in call to readObject");
}
@Override
public void registerValidation(final ObjectInputValidation validation, final int priority)
throws NotActiveException {
throw new NotActiveException("stream inactive");
}
@Override
public void close() {
reader.close();
}
}, classLoaderReference);
}