All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.kemitix.dependency.digraph.maven.plugin.DefaultDotFileFormatFactory Maven / Gradle / Ivy

There is a newer version: 0.9.1
Show newest version
package net.kemitix.dependency.digraph.maven.plugin;

import javax.inject.Inject;

import net.kemitix.node.Node;

/**
 * Default implementation of the {@link DotFileFormatFactory}.
 *
 * @author pcampbell
 */
class DefaultDotFileFormatFactory implements DotFileFormatFactory {

    private final NodePathGenerator nodePathGenerator;

    @Inject
    DefaultDotFileFormatFactory(final NodePathGenerator nodePathGenerator) {
        this.nodePathGenerator = nodePathGenerator;
    }

    @Override
    public DotFileFormat create(
            final String format, final Node base) {
        DotFileFormat reportFormat;
        switch (format) {
        case "simple":
            reportFormat = new DotFileFormatSimple(base, nodePathGenerator);
            break;
        case "nested":
        default:
            reportFormat = new DotFileFormatNested(base, nodePathGenerator);
            break;
        }
        return reportFormat;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy