BaseMapping<M> class
abstract
Base class for all mapping configurations that share common mapper functionality.
This abstract class serves as the foundation for all mapper reference classes like GlobalResourceMapping, LocalResourceMapping, IriMapping, and LiteralMapping. It provides a unified approach to specify mapper selection strategies:
- By name: Use dependency injection to supply a mapper at runtime
- By type: Automatically instantiate a mapper from a given class type
- By instance: Use a pre-configured mapper instance directly
- By factory: Use a factory function to create mappers with optional configuration
This abstraction enables consistent constructor patterns across all mapping types
while maintaining type safety with the generic parameter M defining the expected
mapper interface.
This base class is not intended to be used directly, but rather serves as the foundation for specialized mapping classes.
Constructors
- BaseMapping({String? mapperName, Type? mapperType, M? mapperInstance, String? factoryName, Object? factoryConfigInstance})
-
Creates a base resource mapping with the specified class IRI and mapper configuration.
const
- BaseMapping.mapper(Type mapperType)
-
Creates a reference to a mapper that will be instantiated from the given type.
const
- BaseMapping.mapperInstance(M instance)
-
Creates a reference to a directly provided mapper instance.
const
- BaseMapping.namedFactory(String name, [Object? configInstance])
-
Creates a reference to a named factory function for creating mappers.
const
- BaseMapping.namedMapper(String name)
-
Creates a reference to a named mapper that will be injected at runtime.
const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited