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


public interface BuilderFactory

A BuilderFactory can create a builder from a resolved reference, and can be notified that no resources were found.

A concrete implementation should embed the context expected by the builder factory.

Author:
Philippe Poulard
See Also:
Builder, LookupStrategy

Method Summary
 Builder newBuilder(LocalCatalog localCatalog, CatalogKey key)
          Notify that no resources were found at this step of lookup.
 Builder newBuilder(LocalCatalog localCatalog, CatalogKey key, String resolvedReference)
          Create a context-dependant builder with the given key and resolved reference.
 Builder newBuilder(LocalCatalog localCatalog, CatalogKey key, XFile resolvedReference)
          Create a context-dependant builder with the given key and resolved reference.
 

Method Detail

newBuilder

Builder newBuilder(LocalCatalog localCatalog,
                   CatalogKey key,
                   String resolvedReference)
Create a context-dependant builder with the given key and resolved reference.

The "context" is specific to each concrete implementation.

Parameters:
localCatalog - The local catalog.
key - The key.
resolvedReference - The resolved reference.
Returns:
A non-null builder.

newBuilder

Builder newBuilder(LocalCatalog localCatalog,
                   CatalogKey key,
                   XFile resolvedReference)
Create a context-dependant builder with the given key and resolved reference.

The "context" is specific to each concrete implementation.

Parameters:
localCatalog - The local catalog.
key - The key.
resolvedReference - The resolved reference.
Returns:
A non-null builder.

newBuilder

Builder newBuilder(LocalCatalog localCatalog,
                   CatalogKey key)
Notify that no resources were found at this step of lookup.

This method is called when all local catalogs have been processed and before to try with the parent local catalog. According to the nature of the resource expected, some implementations might return null if nothing special has to be performed here, others could return a default builder or a marker that denotes a special state to store in the registry.

If relevant for the concrete implementation, the builder returned can be a context-dependant builder. The "context" is specific to each concrete implementation.

Parameters:
localCatalog - The local catalog.
key - The key.
Returns:
A builder, or null.