Re: [Simple-support] Simple scripting
Brought to you by:
niallg
|
From: Vladimir K. <me...@li...> - 2009-04-28 10:39:34
|
It's like org.simpleframework.xml.filter.Filter, but returning Object instead
of String. This option is for deserialization only. Example of optimal desired
behavior (CustomHandler should be given to Persister):
<bean class="example.Bean">
<param>${object}</param>
</bean>
@Root
public class Bean {
private Custom object;
@Element
public void setParam(Custom object) {
this.object = object;
}
}
public class Custom {
public int var1;
public int var2;
}
public class CustomHandler implements Handler {
public Object handle(String s) {
// here can be a script interpreter
if ("object".equals(s)) {
Custom c = new Custom();
c.var1 = 13;
c.var2 = 42;
return c;
} else {
return null;
}
}
}
On Вторник 28 апреля 2009 10:30:14 Nia...@ub... wrote:
> Hi,
>
> I am not sure what you mean here. Passing by value and reference? Can you
> provide an example?
> Niall
--
Vladimir Kulev
Mobile: +7 (921) 5554422
Jabber: lig...@ja...
|