org.eclipse.actf.model
Class DefaultModelFactory

java.lang.Object
  extended by org.eclipse.actf.model.DefaultModelFactory
All Implemented Interfaces:
IModelFactory

public class DefaultModelFactory
extends Object
implements IModelFactory

retrieves the desired IModel based upon the raven:model attribute value of the <rulebase> element.

Author:
Mike Squillace
See Also:
"resources/actf.xml"

Constructor Summary
protected DefaultModelFactory()
           
 
Method Summary
static DefaultModelFactory getInstance()
          retrieve the instance of this default factory implementation.
 IModel resolveModel(Class type)
          find a model instance that supports the given type.
 IModel resolveModel(String model)
          retrieve an IModel object for the given model type.
 IModel resolveModel(String modelName, boolean useCache)
          retrieve an IModel object for the given model type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModelFactory

protected DefaultModelFactory()
Method Detail

getInstance

public static DefaultModelFactory getInstance()
retrieve the instance of this default factory implementation.

Returns:
factory instance

resolveModel

public IModel resolveModel(String model)
retrieve an IModel object for the given model type. If a call to this method with the specified type has previously resulted in an IModel object being created, that previously created instance will be returned.

The IBM Rule-based Accessibility Validation Environment currently supports the following models:

Specified by:
resolveModel in interface IModelFactory
Parameters:
model - -- model name as defined in the model extension
Returns:
model appropriate for the given type
See Also:
resolveModel(String, boolean)

resolveModel

public IModel resolveModel(String modelName,
                           boolean useCache)
retrieve an IModel object for the given model type. If a call to this method with the specified type has previously resulted in an IModel object being created and the useCache parameter is true, that previously created instance will be returned.

The IBM Rule-based Accessibility Validation Environment currently supports the following models:

Parameters:
modelName - -- model name as defined in the model extension
useCache - -- if true any previously instantiated model of the specified type will be used else a new IModel object will be created

resolveModel

public IModel resolveModel(Class type)
find a model instance that supports the given type. The configuration of each model includes its 'basetype' attribute, which specifies the superclass of all objects in the hierarchical structure embodied by a model. This basetype is given by the Configuration.MODEL_BASE_TYPE key. This attribute wil be examined for each model type that has been placed into the Configuration.ACTF_ID pool of the active configuration instance.

If more than one model supports the given type, which model type is returned is indeterminant. A cached IModel instance is always used by this method when available.

Parameters:
type - - type for which an model instance is desired
Returns:
model instance that supports the given type or null if no model can be found that supports the given type
See Also:
IConfiguration.MODEL_BASE_TYPE, IConfiguration.getModelTypes()