jastrachan | 29 Mar 17:22 2004
Picon

Re: BuilderSupport modification request

There you go - its in CVS now :)

On 29 Mar 2004, at 16:10, J. Matthew Pryor wrote:
> Is it possible create a method on BuilderSupport called setCurrent & 
> make it
> protected
>
> In order to complete my work I need to be able to set the current node 
> on a
> proxy/Builder and BuilderSupport.current is private with no setter
>
> i.e.
>
> protected void setCurrent(Object current) on BuilderSupport
>
> Thanks,
> Matthew
>
> -----Original Message-----
> From: J. Matthew Pryor [mailto:jmatthewpryor@...]
> Sent: Tuesday, March 23, 2004 8:53 AM
> To: 'groovy-user@...'
> Subject: RE: [groovy-user] BuilderSupport modification request
>
> OK I can cut a deal ;-)
>
> If all the node builder (createNode(XXX), nodeCompleted() etc), proxy
> management (getter & setter rather than just constructor) & current 
> node
> methods (set & get current) were made protected I could probably do 
> what I
> need
>
> Sound fair ...
>
> Thanks again
>
> jmp
>
>> -----Original Message-----
>> From: groovy-user-admin@...
>> [mailto:groovy-user-admin@...] On Behalf Of James
>> Strachan
>> Sent: Monday, March 22, 2004 11:21 PM
>> To: groovy-user@...
>> Subject: Re: [groovy-user] BuilderSupport modification request
>>
>>
>> On 22 Mar 2004, at 12:15, J. Matthew Pryor wrote:
>>
>>> I have this working just fine, all I needed was to change the
>>> visibility of the various node & proxy management methods on
>>> BuilderSupport
>>
>> FWIW you could derive from BuilderSupport to make a new adapter which
>> took a BuilderSupport and invoked its protected methods. i.e. you
>> could achieve what you're trying to do while still keeping the methods
>> protected, since your adapter would be a BuilderSupport
>> implementation.
>>
>>
>>> This is simply a request to see if the committers would
>> consider such
>>> a change to BuilderSupport
>>>
>>> As I say this is all to support a XML pipeline
>>>
>>> I have Jelly integrated with Groovy now & lots of Jelly scripts
>>> produce XML event streams. I wanted to be able to have these events
>>> stream piped back to GroovyMarkup so I could then use
>> groovy code to
>>> write the real scripts
>>>
>>> i.e. I want to be able to reuse Jelly tags and some of its
>> pipelining,
>>> but any complex scripting I want to do in Groovy for (hopefully)
>>> obvious reasons
>>>
>>> i.e.
>>>
>>> builder = new JellyBuilder();
>>> jelly_script = builder.jelly() {
>>> 	jx.parse(var:'doc1'){
>>> 		jc.include(file:'C:\\temp\\wow.xml')
>>> 	}
>>> 	jx.set(var:'count',select:'count($doc1//sub[ <at> name=\'foo\')')
>>> }
>>>
>>> // run the Jelly & adapt the pipelined events into a NodeBuilder
>>> result_node = jelly_script.execute(new NodeBuilder())
>>> result_node.depthFirst().each { n | n.println() }
>>>
>>> Does that make sense ?
>>>
>>> I can send a diff if that will help clarify
>>
>> Wow - wacky stuff :)
>>
>> I totally understand where you're coming from - I'm just wondering if
>> the above proposal (using a special adapter to call the protected
>> methods) would fix it - i.e. to avoid the protected methods being
>> public for all builders.
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>>
>> _______________________________________________
>> groovy-user mailing list
>> groovy-user@...
>> http://lists.codehaus.org/mailman/listinfo/groovy-user
>>
>
> _______________________________________________
> groovy-user mailing list
> groovy-user@...
> http://lists.codehaus.org/mailman/listinfo/groovy-user
>
>

James
-------
http://radio.weblogs.com/0112098/

Gmane