W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2011

Re: Calabash: register an extension step through the API

From: Romain Deltour <rdeltour@gmail.com>
Date: Tue, 6 Sep 2011 11:12:02 +0200
To: Florent Georges <fgeorges@fgeorges.org>
Message-Id: <8D8B6DF0-F558-4CF4-B925-FD65FAC9D377@gmail.com>
Cc: XProc Dev <xproc-dev@w3.org>
>  but rather a way
> to extend the extension mechanism itself by overriding the only
> places it is used from (I guess you overrided isStepAvailable()
> as well).

Exactly :)

Basically our subclass does:

XProcStep xprocStep = registry.getStep(type,runtime,step);
return (xprocStep != null) ? xprocStep : super.newStep(runtime,step);

We totally ignore the "implementations" Map of class names in our  
overridden extension mechanism.

Romain.

Le 6 sept. 11 à 10:54, Florent Georges a écrit :

> On 6 September 2011 09:28, Romain Deltour wrote:
>
>  Hi Romain,
>
>> There is now a new API in XProcConfiguration with a
>> newStep(XProcRuntime, XAtomicStep) method that can be
>> overridden by a subclass to extend the step registration
>> mechanism.
>
>  Thanks.  But from what I see, that's not what I understand this
> method does.  I'd see it rather instantiates an implementation,
> corresponding to a step (in particular its type name).  It gets
> the step's type name, looks up in the extension steps map, and
> instantiates the class if one is found.
>
>  And I don't how a subclass can override this method to add
> anything in the implementations map, given it is... public?  Oh,
> wait a minute, is this field public?  Well, ahem, I don't really
> need a new method, then :-/
>
>  And now that I already wrote my response, I only understand
> what you mean.  You don't mean that overriding the method is a
> way to add a binding to the implementations map, but rather a way
> to extend the extension mechanism itself by overriding the only
> places it is used from (I guess you overrided isStepAvailable()
> as well).
>
>  Interesting, e.g. to experiment with a new extension mechanism
> (based on an ExtensionStep class, providing all infos directly
> from Java, a bit like the extension functions in Saxon 9.2+), and
> that directly from the user space :-)
>
>  Thanks for your ideas!
>
>  Regards,
>
> -- 
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
Received on Tuesday, 6 September 2011 09:12:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 6 September 2011 09:12:37 GMT