Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » [Moxy] Mixed objects(Howto get XML with mixed objects)
[Moxy] Mixed objects [message #692499] Mon, 04 July 2011 11:23 Go to next message
Kasper Thuno is currently offline Kasper Thuno
Messages: 11
Registered: March 2011
Junior Member
Hey,

I have run into a problem which worked with Metro. Using same annotations for EclipseLink just gives nothing.

Consider following XML snippet:

<?xml version="1.0" encoding="ISO-8859-1"?>
<theme>
   <layer downloadable="true" type="point" datasource="ds_bibliotek" name="bibliotek">
[some where important text i want to read into an object]
      <class>
         <name>Bibliotek</name>
         <style>
            <color>255 102 101</color>
            <size>10</size>
            <symbol>square</symbol>
         </style>
      </class>
   </layer>
</theme>


The text node (DOM wise) containing the text "[some where important text i want to read into an object]" is not loaded into the Layer object.

The Java code has this:

@XmlMixed
private ArrayList<Object> objects = new ArrayList<Object>();

.
.
.

@XmlTransient
public ArrayList<Object> getObjects()
{
	return objects;
}

public void setObjects(ArrayList<Object> objects)
{
	this.objects = objects;
}


but nothing is in the Arraylist "objects".

Please help me out!

/Kasper
Re: [Moxy] Mixed objects [message #692600 is a reply to message #692499] Mon, 04 July 2011 16:17 Go to previous messageGo to next message
Matt MacIvor is currently offline Matt MacIvor
Messages: 14
Registered: July 2009
Junior Member
Hi Kaspar,

This looks like a bug in EclipseLink. I took a quick look and have a suspicion of what the problem may be, but will need to get a reproduction going to verify. Once I'm able to verify the cause of the issue I'll open a bug to track the problem.

-Matt
Re: [Moxy] Mixed objects [message #692985 is a reply to message #692600] Tue, 05 July 2011 11:31 Go to previous messageGo to next message
Kasper Thuno is currently offline Kasper Thuno
Messages: 11
Registered: March 2011
Junior Member
Hey Matt,

I cleaned up my Java class a bit, because I had two Arraylists in that class - One as shown above and another to load in the <class> elements. The two lists conflicted with eachother, becase after removing the first one, and annotated the second one with XmlMixed then it worked.

@XmlMixed
@XmlElementRefs({@XmlElementRef(name="class", type=LayerClass.class)})
private ArrayList<Object> lClasses = new ArrayList<Object>();


That ArrayList holds both the string value and the LayerClass elements aswell - so I'm happy Smile

This is on eclipselink-2.3.0.v20110604-r9504 btw.

/Kasper
Re: [Moxy] Mixed objects [message #693085 is a reply to message #692985] Tue, 05 July 2011 14:39 Go to previous message
Matt MacIvor is currently offline Matt MacIvor
Messages: 14
Registered: July 2009
Junior Member
Hi Kaspar,

That's great! The issue in EclipseLink was that @XmlMixed wasn't being recognized to trigger the processing of a private field. Since your new version of the class also has an XmlElementRefs, the processing of the field is correctly being triggered now.

I've put in a fix for the original problem with @XmlMixed. It will be available in nightly 2.4 and 2.3.1 builds starting with tonight's build if you encounter the original problem again.

-Matt
(no subject) [message #693088 is a reply to message #692985] Tue, 05 July 2011 14:39 Go to previous message
Matt MacIvor is currently offline Matt MacIvor
Messages: 14
Registered: July 2009
Junior Member
Hi Kaspar,

That's great! The issue in EclipseLink was that @XmlMixed wasn't being recognized to trigger the processing of a private field. Since your new version of the class also has an XmlElementRefs, the processing of the field is correctly being triggered now.

I've put in a fix for the original problem with @XmlMixed. It will be available in nightly 2.4 and 2.3.1 builds starting with tonight's build if you encounter the original problem again.

-Matt
Previous Topic:(no subject)
Next Topic:Maven static weaving plugin
Goto Forum:
  


Current Time: Sat Aug 30 12:28:34 EDT 2014

Powered by FUDForum. Page generated in 0.01589 seconds