Interface IObjectFactory
Interface for Object Factories which are factory classes that can create Objects based on configuration information in a Graph.
Namespace: VDS.RDF.Configuration
Assembly: dotNetRDF.dll
Syntax
public interface IObjectFactory
Methods
| Improve this Doc View SourceCanLoadObject(Type)
Returns whether this Factory is capable of creating objects of the given type.
Declaration
bool CanLoadObject(Type t)
Parameters
Type | Name | Description |
---|---|---|
System.Type | t | Target Type. |
Returns
Type | Description |
---|---|
System.Boolean |
TryLoadObject(IGraph, INode, Type, out Object)
Attempts to load an Object of the given type identified by the given Node and returned as the Type that this loader generates.
Declaration
bool TryLoadObject(IGraph g, INode objNode, Type targetType, out object obj)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Configuration Graph. |
INode | objNode | Object Node. |
System.Type | targetType | Target Type. |
System.Object | obj | Created Object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the loader succeeded in creating an Object. |
Remarks
The Factory should not throw an error if some required configuration is missing as another factory further down the processing chain may still be able to create the object. If the factory encounters errors and all the required configuration information is present then that error should be thrown i.e. class instantiation throws an error or a call to load an object that this object requires fails.