users@el-spec.java.net

[el-spec users] [jsr341-experts] Identifiers with namespace

From: Kin-man Chung <kinman.chung_at_oracle.com>
Date: Fri, 10 Aug 2012 15:13:28 -0700

There are some feedbacks from the public review. One of them is a
request for adding namespaces to idendifiers.

I know CDI has been using a.b.c.d as namespaced identifiers, but that
creates ambiguities in both the syntax and semantics.

Since we already have namespace for functions, its only logical to use
the same syntax and notation for identifiers. For example,

     ns:obj.foo denotes the property foo of an object with a namespace ns.

Obviously, namespaces are only allowed for top level objections.

Note that there is an ambiguity with the ?: operator.

   What does a? b: d : e mean, a? (b:c): e or a? b: (c: d)?

I think we already have similar problem with namespaced function in :?
operators, so maybe we can reosslve this similarily. Let think about
this more.

How can we fit this into our ELResolver? When an
ELResolver.getValue(Object base, Object property) is invoked, property
is the identifier, as before, but instead of a null base, we can
encapsulate the namespace in "base". So the code will be like

     Object getValue(ELContext context, Object base, Object property) {
         String namespace = null;
         if (base != null && base instance ELNameSpace)
             namespace = ((ELNameSpace)base).getNameSpace();
         }
         ...

What do you think?

Kin-man