Re: Libraries API

Svata Dedic <[email protected]> Thu, 29 May 2003 20:45:29 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Organization CollabNet Hosting
Message-ID <[email protected]>
Petr Kuzel wrote:
> Svatopluk Dedic wrote:
> 
> 
>>A related question: in project resource system, a resource may be
>>decorated by additional content types by independent modules (if they
>>e.g. can convert the original type to their own). Is such data reuse
>>supported in Libraries ?
> 
> You talk too abstract, sorry. I would appreciate an example.
> 

OK - let's say (just as an example, I do not know offhand if it is a 
effective way to do it) we have some JAR resources added as "class 
libraries" (not related to library concept we are talking about though). 
This resource is defined by Java module and its content type is public 
in the APIs, so everyone can query for it and access it.

Suppose a Javadoc module has information like "this jar has 
documentation at http://foobar.com/javadoc", and there's some generic 
documentation access itnerface exposed (like showTOC(), ...).

The client can always use a dedicated JavaDoc API to access 
documentation for JARs specifically. But that means the client can not 
be generic, rather it must depend on the special API, even if it does 
not use any javadoc-specific features, like searching for a symbol's doc.

In project resources, it is possible that JavaDoc module adds an 
Environment Provider and decorate resources that already has 
"JAVA_CLASSES" content type with another content type "DOCUMENTATION" if 
it knows where the relevant doc lies. In theory, it can also add its 
service to the JAR's Lookup content.

The net effect is, that the client, for example an action in the menu 
can query the object _itself_ to provide documentation for it. The 
object's implementation does not know such service (and data), but the 
service can be provided by NetBeans extensibility interface.

-Svata