ImporterFactory

public enum ImporterFactory

The ImporterFactory is used to create the different importer types

  • Return all existing importer types

    As the importers do not need to be called directly, this should only be used in the help to allow displaying the help texts of all importers.

    Declaration

    Swift

    public static var allImporters: [Importer.Type] { get }

    Return Value

    All existing importer types

  • Returns the names of the download importers

    These names can be used to create an importer via the new(ledger:name:) function

    Declaration

    Swift

    public static var downloadImporterNames: [String] { get }

    Return Value

    The names of all existing download importer types

  • Declaration

    Swift

    public static func new(ledger: Ledger?, transaction: String, balance: String) -> Importer?

    Parameters

    ledger

    existing ledger which is used to assist the import, e.g. to read attributes of accounts

    transaction

    text of a transaction

    balance

    text of a balance

    Return Value

    Importer, or nil if the text cannot be imported

  • Creates an Importer to import a file, or nil if the file cannot be imported

    Declaration

    Swift

    public static func new(ledger: Ledger?, url: URL?) -> Importer?

    Parameters

    ledger

    existing ledger which is used to assist the import, e.g. to read attributes of accounts

    url

    URL of the file to import

    Return Value

    Importer, or nil if the file cannot be imported

  • Creates an Inporter which downloads data from the internet

    Declaration

    Swift

    public static func new(ledger: Ledger?, name: String) -> Importer?

    Parameters

    ledger

    existing ledger which is used to assist the import, e.g. to read attributes of accounts

    name

    Name of the importer to initialize

    Return Value

    Importer, or nil if an importer with this name cannot be found