org.netbeans.modules.editor.mimelookup/1 1.3.22

org.netbeans.spi.editor.mimelookup
Interface MimeLookupInitializer


public interface MimeLookupInitializer

Provides an initialization of MimeLookup on either global or mime-type specific level.
The implementations of this class should be registed to default lookup by META-INF/services registration.
Such registered instance serves as a global level initializer which can further be asked for children by child(String) which will lead to forming of a tree initializers hierarchy.
The contents provided by lookup() of the global-level initializer (the one registered in the layer) will automatically appear in all the results returned by MimeLookup for any particular mime type.
Once someone asks for a MimeLookup for a specific mime-type by using MimeLookup.getMimeLookup(String) the global level initializer will be asked for child(String) and the lookup() on the returned children will define the result data (together with the global-level initializer's lookup).
This process can be arbitrarily nested for embedded mime-types.

An example implementation of MimeLookupInitializer that works over xml layer file system can be found at mime lookup module implementation LayerMimeLookupInitializer


Method Summary
 Lookup.Result child(String mimeType)
          Retrieves a Lookup.Result of MimeLookupInitializers for the given sub-mimeType.
 Lookup lookup()
          Lookup providing mime-type sensitive or global-level data depending on which level this initializer is defined.
 

Method Detail

lookup

Lookup lookup()
Lookup providing mime-type sensitive or global-level data depending on which level this initializer is defined.

Returns:
Lookup or null, if there are no lookup-able objects for mime or global level.

child

Lookup.Result child(String mimeType)
Retrieves a Lookup.Result of MimeLookupInitializers for the given sub-mimeType.

Parameters:
mimeType - mime-type string representation e.g. "text/x-java"
Returns:
non-null lookup result of MimeLookupInitializer(s).
Typically there should be just one child initializer although if there will be more than one all of them will be taken into consideration.
If there will be no specific initializers for the particular mime-type then an empty result should be returned.

org.netbeans.modules.editor.mimelookup/1 1.3.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.