org.inria.ns.reflex.processor.catalog
Interface Catalog

All Superinterfaces:
Localizable
All Known Implementing Classes:
Bootstrap.PrimalCatalog, CatalogAction

public interface Catalog
extends Localizable

A catalog translates URIs and external identifier to resolved URIs, and resource names to resolved instances.

A catalog is able to retrieve a resource with a catalog key. A catalog always return a non-null resource object that contains the (possible empty) list of resolved entries (Resource.getEntries()).

If the list of entries is empty, a list of next catalogs to proceed is also contained in the resource object (Resource.getNextCatalogs()).

If the list of entries is not empty, the entries may not suit the client, that may further lookup with the finder iterator (Resource.getNextCatalogs()).

Localizable catalogs

Most catalog instances should be localizable : alternate relative URIs are resolved regarding the base location of this catalog.

As a base location is irrelevant for a pre-compiled catalog, an UnlocalizableException may be thrown. In this case, alternate relative URIs could be resolved upon the user directory, upon the current directory, or upon a default catalog directory.

Author:
Philippe Poulard
See Also:
CatalogKey, Resource

Method Summary
 Resource lookupResources(CatalogKey key)
          Retrieve the resources associated with the given key ; this catalog won't look in the next catalogs by itself ; if a catalog iterator was used to get this catalog, the method Resource.getNextCatalogs() MUST be called ; the resource will be able to supply it to a client that needs to perform further research with the catalog iterator.
 
Methods inherited from interface org.inria.ns.reflex.structures.Localizable
getLocation, isLocalizable, setLocation
 

Method Detail

lookupResources

Resource lookupResources(CatalogKey key)
Retrieve the resources associated with the given key ; this catalog won't look in the next catalogs by itself ; if a catalog iterator was used to get this catalog, the method Resource.getNextCatalogs() MUST be called ; the resource will be able to supply it to a client that needs to perform further research with the catalog iterator.

Parameters:
key - The key of the resource : an identifier + a selector.
Returns:
The non-null resource expected. Check Resource.hasEntry() and Resource.hasNextCatalogs().
See Also:
Resource.getNextCatalogs()