com.inline.feature
Interface FeatureFactory

All Known Implementing Classes:
AbstractFeatureFactory

public interface FeatureFactory

FeatureFactories are responsible for allocation of FeatureSets, which represent sets of child Features of a parent Feature. Factories of all types are registered in the ResourceFactory for the product or a plug-in.

See Also:
FeatureService.getFeatureFactories()

Field Summary
static java.lang.String TYPE
          Resource type for instances of FeatureFactory
 
Method Summary
 FeatureSet allocateChildFeatureSet(Feature parent, java.lang.String type)
          Returns a FeatureSet object which recognizes subfeatures on the supplied parent feature.
 com.sun.java.util.collections.Set getParentFeatureTypes(FeatureModel model, java.lang.String type)
          This factory can only create subfeatures for the feature types returned by this method.
 java.net.URL getParentFeatureURL(FeatureModel model, java.net.URL url)
          Infers parent feature URL from the supplied feature URL.
 com.sun.java.util.collections.Set getSupportedFeatureTypes(FeatureModel model)
          A factory is associated with one or more feature types within the scope of every feature model.
 boolean isEnabled(Feature parent, java.lang.String childType)
          Should return true if the factory is suited to recognize children on this particular parent.
 

Field Detail

TYPE

public static final java.lang.String TYPE
Resource type for instances of FeatureFactory
Method Detail

getSupportedFeatureTypes

public com.sun.java.util.collections.Set getSupportedFeatureTypes(FeatureModel model)
A factory is associated with one or more feature types within the scope of every feature model.

getParentFeatureTypes

public com.sun.java.util.collections.Set getParentFeatureTypes(FeatureModel model,
                                                               java.lang.String type)
This factory can only create subfeatures for the feature types returned by this method. This method is used for optimization of the factory lookup.

isEnabled

public boolean isEnabled(Feature parent,
                         java.lang.String childType)
Should return true if the factory is suited to recognize children on this particular parent. The type of the parent will be one of the types returned by getParentFeatureTypes. The specified child type will be one of the types returned by getSupportedFeatureTypes. Those two conditions do not need to be checked. The method may return false if there is something on the instance of the parent that would prevent the factory from managing children.

Note that Feature caches feature sets, therefore the decision regarding applicability of the factory based on values of dynamic properties of the parent feature should be deferred to the FeatureSet.getFeatures() method.


allocateChildFeatureSet

public FeatureSet allocateChildFeatureSet(Feature parent,
                                          java.lang.String type)
Returns a FeatureSet object which recognizes subfeatures on the supplied parent feature. Note that the overall list of children is composed of sets returned by all relevant factories.

getParentFeatureURL

public java.net.URL getParentFeatureURL(FeatureModel model,
                                        java.net.URL url)
Infers parent feature URL from the supplied feature URL.

This method is used by FeatureModel.getFeature(URL). If the requested feature does not exist yet, FeatureModel calls this method, obtains the parent feature recursively and then creates a child feature for that parent.