Re: [Simple-support] Deserializing Style-Tag
Brought to you by:
niallg
|
From: M. D. <m....@we...> - 2012-08-21 13:50:01
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Thanks a lot for both answers. It works now!<br/>
@Nial: you're right. I need to create myown TreeStrategy too.</div><div><br/></div><div>Regards,<br/></div><div>Maria<br/></div><div><br/></div><div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;">
<b>Gesendet:</b> Dienstag, 21. August 2012 um 04:05 Uhr<br/>
<b>Von:</b> "Niall Gallagher - Yieldbroker" <Nia...@yi...><br/>
<b>An:</b> "Maxim Solodovnik" <sol...@gm...><br/>
<b>Cc:</b> "M. D." <m....@we...>, "sim...@li..." <sim...@li...><br/>
<b>Betreff:</b> RE: [Simple-support] Deserializing Style-Tag
<br/></div>
<div name="quoted-content">
Yes it can, but you will have to create your own TreeStrategy. In Simple the "class" attribute is the default attribute used to store the Java class name. If you want to use this attribute you can do this.<br/>
<br/>
TreeStrategy ts = new TreeStrategy("myIdAttributeName", "myClassAttributeName") // Default is TreeStrategy("id", "class")<br/>
Persister p = new Persister(ts);<br/>
<br/>
This will allow you yo use the "class" attribute.<br/>
<br/>
-----Original Message-----<br/>
From: Maxim Solodovnik [mailto:sol...@gm...] <br/>
Sent: Tuesday, 21 August 2012 11:55 AM<br/>
To: Niall Gallagher - Yieldbroker<br/>
Cc: M. D.; sim...@li...<br/>
Subject: Re: [Simple-support] Deserializing Style-Tag<br/>
<br/>
I believe it is something like<br/>
<br/>
<div class="button" style="..." ...></div><br/>
<br/>
can not be mapped directly to<br/>
@Root<br/>
class Div {<br/>
private String class; // <-- error is here }<br/>
<br/>
can easily be implemented as<br/>
<br/>
@Root<br/>
class Div {<br/>
@Attribute(name="class")<br/>
private String cssClass; // <-- no error }<br/>
<br/>
something like this<br/>
<br/>
On Tue, Aug 21, 2012 at 5:47 AM, Niall Gallagher - Yieldbroker <Nia...@yi...> wrote:<br/>
> Can you provide an example, I am not sure what you are talking about.<br/>
><br/>
><br/>
><br/>
> From: M. D. [mailto:m....@we...]<br/>
> Sent: Monday, 20 August 2012 9:37 PM<br/>
> To: sim...@li...<br/>
> Subject: [Simple-support] Deserializing Style-Tag<br/>
><br/>
><br/>
><br/>
> Hello,<br/>
><br/>
><br/>
><br/>
> I would like to deserialize Style-tag of html with Simple. I noticed <br/>
> that the attribute "class" can't be mapped to an Instance variable in java.<br/>
><br/>
> Is there any solution for that?<br/>
><br/>
><br/>
><br/>
> Thanks in advance<br/>
><br/>
><br/>
> ----------------------------------------------------------------------<br/>
> --------<br/>
> Live Security Virtual Conference<br/>
> Exclusive live event will cover all the ways today's security and <br/>
> threat landscape has changed and how IT managers can respond. <br/>
> Discussions will include endpoint security, mobile security and the <br/>
> latest in malware threats. <br/>
> <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br/>
> _______________________________________________<br/>
> Simple-support mailing list<br/>
> Sim...@li...<br/>
> <a href="https://lists.sourceforge.net/lists/listinfo/simple-support" target="_blank">https://lists.sourceforge.net/lists/listinfo/simple-support</a><br/>
><br/>
<br/>
<br/>
<br/>
--<br/>
WBR<br/>
Maxim aka solomax<br/>
</div>
</div><div><br/><br/></div></div></body></html>
|