Hi Nikita,
my first reaction was: Ahh, no, this is not possible. XStream has a stream-based model and therefore ... blah, blah. However, looking at the patch I realized that the different streaming readers already read one element ahead - it's just not exposed. Boy, that reader code was written before my time
Now, after playing a bit with enhanced unit tests and fixing some stuff, I have it running. The problem is, that we cannot simply extend the HierarchicalStreamReader without seriously breaking backwards compatibility. All that currently comes to my mind is:
interface ExtendedHierarchicalStreamReader extends HierarchicalStreamReader {
String peekNextChild();
}
XStream's own reader implementations would implement this, but you would have to cast the provided reader in the converters yourself. Unfortunately this implies also that we cannot use it in our own converters for now (TreeSetConverter/TreeMapConverter). Any other idea?
Hi Nikita,
my first reaction was: Ahh, no, this is not possible. XStream has a stream-based model and therefore ... blah, blah. However, looking at the patch I realized that the different streaming readers already read one element ahead - it's just not exposed. Boy, that reader code was written before my time
Now, after playing a bit with enhanced unit tests and fixing some stuff, I have it running. The problem is, that we cannot simply extend the HierarchicalStreamReader without seriously breaking backwards compatibility. All that currently comes to my mind is:
XStream's own reader implementations would implement this, but you would have to cast the provided reader in the converters yourself. Unfortunately this implies also that we cannot use it in our own converters for now (TreeSetConverter/TreeMapConverter). Any other idea?