Class BaseToolFactory
Base class for all tool factories.
Extensions of this class should:
- implement an empty constructor (TODO is it necessary?)
- implement a constructor that takes the IArtifactProvider and
calls
BaseToolFactory(Map) - override CreateArtifactMap() and CreateArtifactSerializersMap() methods if necessary.
public abstract class BaseToolFactory
- Inheritance
-
BaseToolFactory
- Derived
- Inherited Members
Constructors
BaseToolFactory()
All sub-classes should have an empty constructor
protected BaseToolFactory()
Fields
artifactProvider
protected IArtifactProvider? artifactProvider
Field Value
Methods
Create(string, IArtifactProvider)
public static BaseToolFactory? Create(string subclassName, IArtifactProvider artifactProvider)
Parameters
subclassNamestringartifactProviderIArtifactProvider
Returns
Create(Type?, IArtifactProvider)
public static BaseToolFactory? Create(Type? factoryClass, IArtifactProvider artifactProvider)
Parameters
factoryClassTypeartifactProviderIArtifactProvider
Returns
CreateArtifactMap()
Creates an IDictionary<TKey, TValue> with pairs of keys and objects. The models implementation should call this constructor that creates a model programmatically.
The base implementation will return a Dictionary<TKey, TValue> that should be populated by sub-classes.
public virtual IDictionary<string, object> CreateArtifactMap()
Returns
CreateArtifactSerializersMap()
Creates an IDictionary<TKey, TValue> with pairs of keys and IArtifactSerializer.
The models implementation should call this method from
BaseModel.CreateArtifactSerializersMap
The base implementation will return a Dictionary<TKey, TValue> that should be populated by sub-classes.
public virtual IDictionary<string, IArtifactSerializer> CreateArtifactSerializersMap()
Returns
CreateManifestEntries()
Creates the manifest entries that will be added to the model manifest
public virtual IDictionary<string, string> CreateManifestEntries()
Returns
- IDictionary<string, string>
the manifest entries to added to the model manifest
Init(IArtifactProvider)
Initializes the ToolFactory with an artifact provider.
protected virtual void Init(IArtifactProvider artifactProvider)
Parameters
artifactProviderIArtifactProvider
ValidateArtifactMap()
Validates the parsed artifacts. If something is not valid subclasses should throw an InvalidFormatException.
Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.
public abstract void ValidateArtifactMap()