net.kemitix.dependency.digraph.maven.plugin.DefaultDotFileFormatFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of digraph-dependency-maven-plugin Show documentation
Show all versions of digraph-dependency-maven-plugin Show documentation
Generates a DOT Digraph of dependencies between packages within a project
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