Questions tagged [xmlencoder]

XMLEncoder converts a JavaBean into XML text.

XMLEncoder converts a JavaBean into XML text. See also XMLDecoder in java.beans.

36 questions
1
vote
1 answer

Drop-in replacement for java.beans.XMLEncoder

I've got lots XSL transforms that rely on the java.beans.XMLEncoder XML format, and I'm wondering if I can find a drop-in replacement lib that has better performance. I've looked at XStream but its serialization format is different. I'm looking to…
Benn
  • 1,410
  • 10
  • 16
1
vote
1 answer

Trying to convert an object array into XML, can't get object headers

I'm using this XML converter, but I am not getting the object header to wrap each object's properties... I can't find a method in the encoder class to do this either. The code iterates through my array and lists all objects that are not…
Lurx
  • 25
  • 4
0
votes
2 answers

Serialize a UUID with XMLEncoder

I'm using XMLEncoder to write an object graph to a XML file. That works fine, except for the UUID property (which has the name id in my JavaBean) I know that I need a PersistenceDelegate to get it done. I wrote the following one: class…
0
votes
1 answer

Not able to encode , (comma) _(underscore) -(hyphen) using ESAPI encodeforXML method

In the following code, where I am trying to encode special characters package hello; //import java.io.UnsupportedEncodingException; import org.owasp.esapi.ESAPI; import org.owasp.esapi.Encoder; import…
Adharsh
  • 3
  • 2
0
votes
2 answers

Problem with "import java.beans.XMLEncoder" in Eclipse

I am trying to use XMLEncoder to serialize my java object for Android app which I need to further deserialize in c# server. To import XMLEncoder in eclipse I use: import java.beans.XMLEncoder; The error i get for this import line is: The import…
Shaleen
  • 3
  • 2
0
votes
1 answer

How to serialize Java ZonedDateTime to XML file

Error while serializing ZonedDateTime (it doesn't appear in the output xml at all): java.lang.InstantiationException: java.time.ZonedDateTime Continuing ... java.lang.RuntimeException: failed to evaluate: =Class.new(); Continuing ... I have an…
emsiiggy
  • 343
  • 1
  • 2
  • 13
0
votes
1 answer

XMLEncoder not writing object data when class fields are private

I have a class with private fields and public methods. My methods follow the get/set naming convention. When my fields are private and I try to write my object data to an XML file, I get an empty XML file, but when I change them to public, the XML…
Brosef
  • 2,945
  • 6
  • 34
  • 69
0
votes
2 answers

XMLEncoder does not encode zero values

I'm encoding a short integer with value 0 and XMLEncoder does not encode it. How can I force it?
daigorocub
  • 786
  • 8
  • 15
0
votes
1 answer

XMLEncoder writeObject skips properties initialized in constructor

How does XMLEncoder know that a property was set in the object's constructor, and thus avoid outputting it ? Here is a simple example (run on Java 1.8) which demonstrates this: First define a simple object with getters and setters and a default…
0
votes
1 answer

excluding byte[] from serialization of XMLEncoder

The problem is how to except an byte[] from serialization of XMLEncoder, but i need to save this field to DB. I have a Object public class MyClass1 implements Serializable { some properties ... private byte[] a01_14_01_content; getters and…
zond
  • 1,473
  • 1
  • 21
  • 34
0
votes
2 answers

Why did I get this error : java.lang.Exception: XMLEncoder: discarding statement Vector.add()?

My Java program look like this : public class Biz_Manager { static Contact_Info_Setting Customer_Contact_Info_Panel; static XMLEncoder XML_Encoder; ...... void…
Frank
  • 30,590
  • 58
  • 161
  • 244
0
votes
0 answers

Java XMLEncoder Enum behavior unexpected

I have run into what I think is a problem with enums and the XMLEncoder. The enums are only being correctly encoded once so my output is like:
phil b
  • 36
  • 1
  • 3
0
votes
2 answers

How to write a JTable state with data in xml file using XMLEndcoder in java

I want to save JTable in xml file using XMLEncoder. When we are saving it into a file, getting an exception: java.lang.InstantiationException: javax.swing.plaf.basic.BasicTableUI$Handler Continuing ... java.lang.Exception: XMLEncoder: discarding…
Arvind Singh
  • 75
  • 2
  • 6
0
votes
1 answer

Does XMLEncoder guarantee a fixed order on an encoded object's fields?

If I encode a class with java.beans.XMLEncoder (Java 1.6) like the following: fileOutputStream = new FileOutputStream(someFile); XMLEncoder xmlEncoder = new XMLEncoder(fileOutputStream); xmlEncoder.writeObject(anyObject); xmlEncoder.close(); the…
ptikobj
  • 2,690
  • 7
  • 39
  • 64
0
votes
2 answers

How to disable the redundancy elimination feature of XMLEncoder to ensure POJOs completely serialised?

I have been using XMLEncoder to transform POJOs into XML and back again. Apart from storing POJOs, some XML output will also be used by other applications to generate other forms of data, such as reports. So far this has worked well. Even as the…
paul
  • 13,312
  • 23
  • 81
  • 144