users@jsr311.java.net

Re: JAX-RS: _at_Path limited=false templates: (?!/).+(?<!/)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 03 Jul 2008 15:02:57 +0200

Bill Burke wrote:
>> - URI matchers could be used as URI templates, although an unnamed
>> variable cause issues when constructing
>> the URI as information is lost. Thus i am wondering if they should
>> be disallowed and we should require a name
>> and that template variable name/value may be ignored e.g. call it
>> 'noname'. Or a perhaps a known name is
>> assigned if one is absent e.g. _1, _2 etc.
>>
>
> For URI templates you mean the RFC?

I was referring to the URI template subset that JAX-RS currently supports.


> If not, then I think this is just
> an implementation detail.
>

Which bit? auto-naming of unnamed variables, support for unnamed
variables? UriBuilder specifies building from a resource class or adding
one or more path segments from a resource class.

>
>> It is possible to determine using javax.util.regex.Pattern/Matcher
>> the number of capturing groups in an expression.
>> Tis a bit funky but one compiles the pattern and obtains a matcher,
>> m say, for say "", then one calls m.groupCount().
>> Thus it may also be possible to assign names to such sub-groups as
>> is the case for unnamed template variables. Or
>> it may be possible to easily reject a regex that contains capturing
>> groups.
>>
>
> I say we prototype it and flush out the details through code.
>

We need to work quickly, time is against us...

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109