Using your own context or writer [message #53748] |
Fri, 05 December 2008 18:09  |
Eclipse User |
|
|
|
Hi,
Is it possible to have JET create owns own JET2Context implementation
and/or JET2Writer rather than the standard ones? A factory one could
implement and supply to the JET2 plugin definition or something of that
nature so that JET would call your factory to create a context or writer
when it needed to rather than the default one?
Also what is the difference between c:include and c:invokeTransform?
Finally,
Paul
|
|
|
|
Re: Using your own context or writer [message #54494 is a reply to message #53828] |
Wed, 17 December 2008 11:12  |
Eclipse User |
|
|
|
I guess to a certain extent, it allows you to have easy tap in points.
For instance, supposing I wanted to log everything being added into and
out of the JET2Context, as I have no control over the creation of the
JET2Context, I cannot simply do that.
Or supposing everything being written into the JET2Writer I wanted to
either analyse (without interfering with template generation) or filter
and pass into some other function or process as a side effect etc, or pass
through a translator before writing it back out, who knows.
What I propose is this. We already have to specify a TagInstanceFactory
when we create a transformation in JET.
Just change this to a JetFactory with 3 create methods, the existing
createCustomTag and new createJET2Context and createJET2Writer methods.
You can then supply an AbstractJetFactory implementation in JET which
supplies default methods for the createJET2Context and createJET2Writer
methods, and have the user implement the one createCustomTag method as
before but allow them the power to create their own context or writer
should they need to.
Paul
|
|
|
Powered by
FUDForum. Page generated in 0.03391 seconds