![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.anim.AnimationDecoder 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.anim;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
public class AnimationDecoder {
private final List result = new ArrayList<>();
public AnimationDecoder(Iterable data) {
for (final Iterator it = data.iterator(); it.hasNext();) {
String line = it.next().toString();
if (line.matches("^\\s*\\[script\\]\\s*$")) {
final StringBuilder scriptText = new StringBuilder();
while (true) {
line = it.next().toString();
if (line.matches("^\\s*\\[/script\\]\\s*$")) {
final AnimationScript script = new AnimationScript();
final String out = script.eval(scriptText.toString());
for (final StringTokenizer st = new StringTokenizer(out, "\n"); st.hasMoreTokens();) {
result.add(st.nextToken());
}
break;
} else {
scriptText.append(line);
scriptText.append("\n");
}
}
} else {
result.add(line);
}
}
}
public List decode() {
return Collections.unmodifiableList(result);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy