com.inline.feature
Interface FeatureConstructorFactory

All Known Implementing Classes:
AbstractFeatureConstructorFactory

public interface FeatureConstructorFactory

FeatureConstructorFactories produce FeatureConstructors for child FeatureSets of Features. Factories of all types are registered in the ResourceFactory for the product or a plug-in.

There are two types features constructors:

FeatureSet.getFeatureConstructors() returns a combination of both types.

Only the primitive feature constructors can allocate features directly. Add-on constructors must use other constructors to allocate features.

See Also:
FeatureService.getFeatureConstructorFactories()

Field Summary
static java.lang.String TYPE
          Resource type for instances of FeatureFactory
 
Method Summary
 com.sun.java.util.collections.Set getFeatureConstructors(Feature parent, java.lang.String type)
          Returns a Set 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.
 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 create 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.

isEnabled

public boolean isEnabled(Feature parent,
                         java.lang.String childType)
Should return true if the factory is suited to create 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 creating a feature constructor.

Note that the Feature will cache feature constructors, so the decision about applicability of the particular constuctor based on dynamically changing properties of the feature should be deferred to FeatureConstructor.isEnabled().


getFeatureConstructors

public com.sun.java.util.collections.Set getFeatureConstructors(Feature parent,
                                                                java.lang.String type)
Returns a Set 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.