Hello world!

I've tried to google as hard as I can, but I didn't find an answer for my 
problems.

1. The problem is that due to some reason our protocol has identical XML 
structure for all packets, so I can't create permanent aliases, neither using 
annotations nor by calling XStream.alias().
Also I have to mention that calling XStream.processAnnotations() before each 
packet parsing is not appropriate because it is (AFAIK) "heavy" operation.
I tried to call xStream.alias("A", ClassA.class) (ClassA, ClassB, ClassC, etc) 
on the fly before parsing each packet, but nothing (good) happened.
Then I've digged into the sources, and found that 
ClassAliasingMapper.addTypeAlias() only adds aliases, and in case of any 
duplicates (both name and class) there is no way to removed old alias.
Is it true, or I'm missing something? If it is true there is an another 
question - is it possible to do anything in such case (the same XML structure 
for all packets)?
In case if it is impossible now - I would be extremely grateful if somebody can 
add something like XStream.removeAlias();

2. I have very simple XML with structure: <D><I></I><D>, but doing 
XStream.alias("D", ClassD.class); XStream.alias("I', ClassI.class); results in 
an exception telling me that there is no class registered to save contents of 
tag "I".
Only XStream.alias("D", ClassD.class); XStream.aliasField("I', ClassD.class, 
"fieldI"); works as required. Why it is impossible to just set two aliases for 
two pairs tag-class?

Thanks to everybody in advance.

-- 
10:36  13.04.2015             Alex Y. Matiash   mailto:[email protected]


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to