![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.preproc.DefineVariable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.preproc;
public class DefineVariable {
private final String name;
private final String defaultValue;
public DefineVariable(String name) {
name = name.trim();
final int idx = name.indexOf('=');
if (idx == -1) {
this.name = name;
this.defaultValue = null;
} else {
this.name = name.substring(0, idx).trim();
final String right = name.substring(idx + 1).trim();
this.defaultValue = right.substring(1, right.length() - 1);
}
}
public String getName() {
return name;
}
public String getDefaultValue() {
return defaultValue;
}
public DefineVariable removeDefault() {
if (defaultValue == null) {
throw new IllegalStateException();
}
return new DefineVariable(name);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy