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

net.sourceforge.plantuml.directdot.PSystemDotFactory Maven / Gradle / Ivy

There is a newer version: 1.2025.0
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.directdot;

import net.sourceforge.plantuml.command.PSystemBasicFactory;
import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource;

public class PSystemDotFactory extends PSystemBasicFactory {

	private StringBuilder data;

	public PSystemDotFactory(DiagramType diagramType) {
		super(diagramType);
	}

	@Override
	public PSystemDot initDiagram(UmlSource source, String startLine) {
		data = null;
		return null;
	}

	@Override
	public PSystemDot executeLine(UmlSource source, PSystemDot system, String line) {
		if (system == null && line.matches("(strict\\s+)?(di)?graph\\s+\"?[-\\w]+\"?\\s*\\{")) {
			data = new StringBuilder(line);
			data.append("\n");
			return new PSystemDot(source, data.toString());
		}
		if (data == null || system == null)
			return null;

		data.append(line);
		data.append("\n");
		return new PSystemDot(source, data.toString());
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy