class MatpowerImporter implements Importer {

    @Override
    public Network importData(ReadOnlyDataSource dataSource, NetworkFactory networkFactory, Properties parameters) {
        Objects.requireNonNull(dataSource);
        Objects.requireNonNull(networkFactory);
        Network network = networkFactory.createNetwork(dataSource.getBaseName(), FORMAT);

        //there is no time & date declared in the MATPOWER file: set a default now()
        network.setCaseDate(DateTime.now());

        try {
            try (InputStream iStream = dataSource.newInputStream(null, EXT)) {

                MatpowerModel model = MatpowerReader.read(iStream, dataSource.getBaseName());
                LOGGER.debug("MATPOWER model {}", model.getCaseName());

                ContainersMapping containerMapping = ContainersMapping.create(model.getBuses(), model.getBranches(),
                    MBus::getNumber, MBranch::getFrom, MBranch::getTo, branch -> 0, MBranch::getR, MBranch::getX, MatpowerImporter::isTransformer,
                    busNums -> getId(VOLTAGE_LEVEL_PREFIX, busNums.iterator().next()), substationNum -> getId(SUBSTATION_PREFIX, substationNum));

                boolean ignoreBaseVoltage = ConversionParameters.readBooleanParameter(FORMAT, parameters, IGNORE_BASE_VOLTAGE_PARAMETER,
                        ParameterDefaultValueConfig.INSTANCE);

                PerUnitContext perUnitContext = new PerUnitContext(model.getBaseMva(), ignoreBaseVoltage);

                createBuses(model, containerMapping, network, perUnitContext);

                createBranches(model, containerMapping, network, perUnitContext);
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }

        return network;
    }

}