Here's our code:
In the Engine:
public DataSqueezer createDataSqueezer() {
DataSqueezer squeezer = new DataSqueezer(getResourceResolver
(), new ISqueezeAdaptor[] { new SectionActionItemAdaptor()});
return squeezer;
}
The Squeeze Adaptor:
public class SectionActionItemAdaptor implements ISqueezeAdaptor {
public void register(DataSqueezer squeezer) {
squeezer.register(SectionActionItem.PREFIX,
SectionActionItem.class, this);
}
public String squeeze(DataSqueezer squeezer, Object data) throws
IOException {
SectionActionItem item = (SectionActionItem) data;
return item.squeeze();
}
public Object unsqueeze(DataSqueezer squeezer, String string)
throws IOException {
return new SectionActionItem(string);
}
}
We put the squeeze() method into the object being squeezed rather
than the adaptor for ease of testing. We also made a constructor for
the unsqueeze method.
BTW, SectionActionItem does implement serializable.
Jamie
On Sep 27, 2005, at 6:47 PM, Ron Piterman wrote:
Hi,
I have a class for which I would like to write a custom squeezer.
The class also implements serializable.
Is it possible to use a custom squeezer, or will tapestry first use
the serializable one?
Cheers,
Ron
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]