简体   繁体   中英

Howto prevent XStream from displaying class=“string”?

Is there a way to prevent XStream from displaying something like follows:

<user class="string">user</user>
<password class="string">password</password>

in an xml output?

Omitted Fields

For a proper deserialization XStream has to write the complete object graph into XML that is referenced by a single object. Therefore XStream has to find a representation that contains all aspects to recreate the objects.

However, some parts might be superfluous eg if a member field is lazy initialized and its content can be easily recreated. In such a case a field can be omitted using XStream.omitField(Class, String) .

@See: xStream Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM