Reputation: 1
Xml is work only class is public.what i do if class is not public?
Upvotes: 0
Views: 64
Reputation: 14232
For Java, java.beans.XMLDecoder
also only unmarshalls public classes. There is no way to overwrite this behavior and to provide custom object handlers.
There are other libraries, such as XStream, which have various options to encode/decode other types of classes, control the marshalling process or use factory classes to create instances of private classes which were otherwise not accessible.
Upvotes: 0
Reputation: 1038930
If you are talking about .NET XML serialization with XmlSerializer then this type can serialize only public classes. You could use DataContractSerializer instead.
Upvotes: 2