[stringtemplate-interest] ST4: serializable for Template for Template Group?

Collin Fagan collin.fagan at gmail.com
Sun Apr 17 18:29:30 PDT 2011


Honestly I just inherited from StringTemplateGroup and StringTemplate (in
ST3) and implemented Serialaizeable. It works for me. I had not thought too
deeply about it, mostly because it worked, but that's probably because I
don't use an error handler.  This is an issue because others will implement
an error handler that won't necessarily be Serializable? I think in that
case you would get a Serializable error, and then be forced to implement
Serializable or not use serialization. I guess that would go for model
adapters also... and renderers.

Collin

P.S.

I think you mean transient not volatile.

On Sun, Apr 17, 2011 at 6:54 PM, Terence Parr <parrt at cs.usfca.edu> wrote:

> Was wondering about that.  Collin: what did you need to do to get it to
> serialize?
> Ter
> On Apr 17, 2011, at 3:19 PM, Rafael Chaves wrote:
>
> > Correct me if I am wrong, but I don't think marking those classes as
> > Serializable achieves anything. In order for them to be serializable
> > using the default mechanism, all of their slots must be serializable,
> > or marked as volatile, which is not the case for the error listener in
> > StringTemplate/StringTemplateGroup, for instance, at least in version
> > 3.
> >
> > On Sun, Apr 17, 2011 at 11:56 AM,
> > <stringtemplate-interest-request at antlr.org> wrote:
> >> Date: Sun, 17 Apr 2011 09:37:10 -0700
> >> From: Terence Parr <parrt at cs.usfca.edu>
> >> Subject: Re: [stringtemplate-interest] ST4: serializable for Template
> >>        for     Template Group?
> >> To: stringtemplate-interest List <stringtemplate-interest at antlr.org>
> >> Message-ID: <A21307C9-2AAD-4740-BD2C-936FE9705F62 at cs.usfca.edu>
> >> Content-Type: text/plain; charset=us-ascii
> >>
> >> Hmm...oh,So you don't want me to actually specify the implementation,
> just insert "implements Serializable"?
> >>
> >> Ter
> >> On Apr 15, 2011, at 7:07 AM, Collin Fagan wrote:
> >>
> >>> Hi Ter,
> >>>
> >>> I've been using ST with Apache Wicket. Wicket uses serialization for
> short term storage of state. I'd like to be able to serialize a template
> and/or template group with my wicket page. Can you implement serializable in
> ST4? It really is just a marker interface, I'm not asking for a long term
> commit to any particular serialization strategy. Right now I subclass
> StringTemplateGroup and StringTemplate in ST3 and impliment Serializable to
> get around this.
> >>>
> >>> Thanks,
> >>>
> >>> Collin
> >>> _______________________________________________
> >>> stringtemplate-interest mailing list
> >>> stringtemplate-interest at antlr.org
> >>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
> > _______________________________________________
> > stringtemplate-interest mailing list
> > stringtemplate-interest at antlr.org
> > http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110417/f9c6fe58/attachment.html 


More information about the stringtemplate-interest mailing list