public class SimpleFeatureRealizer extends Object implements FeatureRealizer, SerializableFeatureRealizer which uses a lookup table to map template classes to implementations. Optionally, this implementation can fall back on another FeatureRealizer if it fails.
When searching for a Feature implementation to match a specific Feature.Template class, the following search order is used:
- Mappings added to this SimpleFeatureRealizer, in reverse order of addition.
- Any mappings known to the fallback realizer, if one is installed.
- If no mapping can be found, a BioException is thrown.
- Thomas Down
- See Also:
- Serialized Form
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
addImplementation(Class template, Class impl)Install a new mapping from a class of Feature.Template to a class of Feature implementations.
realizeFeature(Sequence seq, FeatureHolder parent, Feature.Template temp)Install a feature on the specified sequence.
public void addImplementation(Class template, Class impl) throws BioExceptionInstall a new mapping from a class of Feature.Template to a class of Feature implementations. The implementation class MUST have a public constructor of the form (Sequence, FeatureHolder, Feature.Template).
A newly added implementation takes precendence over any existing implementations if a template can be realized by more than one implementation.
template- The class of templates to implement.
impl- A class of Feature which can be used to implement these templates.
public Feature realizeFeature(Sequence seq, FeatureHolder parent, Feature.Template temp) throws BioExceptionDescription copied from interface:
FeatureRealizerInstall a feature on the specified sequence.
- Specified by:
seq- The sequence to which the feature will be added.
parent- The FeatureHolder which is to be the Feature's immediate parent.
temp- A description of the desired feature.
- A newly constructed feature, to be added to the sequence.
BioException- If the feature could not be constructed.