Inject

public protocol Inject

The Inject protocol is the supporter that injects the dependency type.

It is not registered in IoC conatiner, but is registered in Graph at the time of build, and checks whether there is an invalid reference.

Static

  • Get instance for type.

    Declaration

    Swift

    static func Inject<T>(
        _ type: T.Type,
        qualifier: String? = nil,
        resolveRole: ResolveRole = .recursive
    ) -> T

    Parameters

    type

    The dependency type to resolve.

    qualifier

    The registered qualifier.

    resolveRole

    The resolve role(default: recursive)

    Return Value

    The resolved instance.

  • Get instance list for type.

    Declaration

    Swift

    static func Inject<T>(
        _ type: [T].Type,
        qualifier: String? = nil,
        resolveRole: ResolveRole = .default
    ) -> [T]

    Parameters

    type

    The dependency type to resolve.

    qualifier

    The registered qualifier.

    resolveRole

    The resolve role.

    Return Value

    The resolved instances, or empty.

  • Inject(_:with:resolveRole:) Extension method

    Get instance for type by factory.

    Declaration

    Swift

    static func Inject<T: Factory>(
        _ type: T.Type,
        with argument: T.RawPayload.Tuple,
        resolveRole: ResolveRole = .recursive
    ) -> T

    Parameters

    type

    The dependency type to resolve.

    argument

    User data for resolve.

    resolveRole

    The resolve role(default: recursive)

    Return Value

    The resolved instance.

  • Inject(_:with:resolveRole:) Extension method

    Get instance list for type by factory.

    Declaration

    Swift

    static func Inject<T: Factory>(
        _ type: [T].Type,
        with argument: T.RawPayload.Tuple,
        resolveRole: ResolveRole = .default
    ) -> [T]

    Parameters

    type

    The dependency type to resolve.

    argument

    User data for resolve.

    resolveRole

    The resolve role.

    Return Value

    The resolved instances, or emtpy.

  • Get instance for type.

    Declaration

    Swift

    static func Inject<T>(
        _ type: T.Type,
        qualifierBy: String,
        resolveRole: ResolveRole = .recursive
    ) -> T

    Parameters

    type

    The dependency type to resolve.

    qualifierBy

    The registered qualifier by property.

    resolveRole

    The resolve role(default: recursive)

    Return Value

    The resolved instance.

  • Get instance list for type.

    Declaration

    Swift

    static func Inject<T>(
        _ type: [T].Type,
        qualifierBy: String,
        resolveRole: ResolveRole = .default
    ) -> [T]

    Parameters

    type

    The dependency type to resolve.

    qualifierBy

    The registered qualifier by property.

    resolveRole

    The resolve role.

    Return Value

    The resolved instances, or empty.

  • Get property.

    Declaration

    Swift

    static func InjectProperty(
        _ path: String,
        resolveRole: ResolveRole = .default
    ) -> String

    Parameters

    path

    Property path.

    resolveRole

    The resolve role.

    Return Value

    The property.

Public

  • Get instance for type.

    Declaration

    Swift

    func Inject<T>(
        _ type: T.Type,
        qualifier: String? = nil,
        resolveRole: ResolveRole = .recursive
    ) -> T

    Parameters

    type

    The dependency type to resolve.

    qualifier

    The registered qualifier.

    resolveRole

    The resolve role(default: recursive)

    Return Value

    The resolved instance.

  • Get instance list for type.

    Declaration

    Swift

    func Inject<T>(
        _ type: [T].Type,
        qualifier: String? = nil,
        resolveRole: ResolveRole = .default
    ) -> [T]

    Parameters

    type

    The dependency type to resolve.

    qualifier

    The registered qualifier.

    resolveRole

    The resolve role.

    Return Value

    The resolved instances, or empty.

  • Inject(_:with:resolveRole:) Extension method

    Get instance for type by factory.

    Declaration

    Swift

    func Inject<T: Factory>(
        _ type: T.Type,
        with argument: T.RawPayload.Tuple,
        resolveRole: ResolveRole = .recursive
    ) -> T

    Parameters

    type

    The dependency type to resolve.

    argument

    User data for resolve.

    resolveRole

    The resolve role(default: recursive)

    Return Value

    The resolved instance.

  • Inject(_:with:resolveRole:) Extension method

    Get instance list for type by factory.

    Declaration

    Swift

    func Inject<T: Factory>(
        _ type: [T].Type,
        with argument: T.RawPayload.Tuple,
        resolveRole: ResolveRole = .default
    ) -> [T]

    Parameters

    type

    The dependency type to resolve.

    argument

    User data for resolve.

    resolveRole

    The resolve role.

    Return Value

    The resolved instances, or emtpy.

  • Get instance for type.

    Declaration

    Swift

    func Inject<T>(
        _ type: T.Type,
        qualifierBy: String,
        resolveRole: ResolveRole = .recursive
    ) -> T

    Parameters

    type

    The dependency type to resolve.

    qualifierBy

    The registered qualifier by property.

    resolveRole

    The resolve role(default: recursive)

    Return Value

    The resolved instance.

  • Get instance list for type.

    Declaration

    Swift

    func Inject<T>(
        _ type: [T].Type,
        qualifierBy: String,
        resolveRole: ResolveRole = .default
    ) -> [T]

    Parameters

    type

    The dependency type to resolve.

    qualifierBy

    The registered qualifier by property.

    resolveRole

    The resolve role.

    Return Value

    The resolved instances, or empty.

  • Get property.

    Declaration

    Swift

    func InjectProperty(
        _ path: String,
        resolveRole: ResolveRole = .default
    ) -> String

    Parameters

    path

    Property path.

    resolveRole

    The resolve role.

    Return Value

    The property.