com.vladsch.flexmark.html2md.converter.HtmlConverterState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cql-shaded Show documentation
Show all versions of driver-cql-shaded Show documentation
A Shaded CQL ActivityType driver for http://nosqlbench.io/
package com.vladsch.flexmark.html2md.converter;
import com.vladsch.flexmark.util.html.Attributes;
import org.jsoup.nodes.Node;
import java.util.LinkedList;
import java.util.List;
public class HtmlConverterState {
final Node myParent;
final List myElements;
int myIndex;
final Attributes myAttributes;
private LinkedList myPrePopActions;
HtmlConverterState(Node parent) {
myParent = parent;
myElements = parent.childNodes();
myIndex = 0;
myAttributes = new Attributes();
myPrePopActions = null;
}
public Node getParent() {
return myParent;
}
public void addPrePopAction(Runnable action) {
if (myPrePopActions == null) {
myPrePopActions = new LinkedList<>();
}
myPrePopActions.add(action);
}
public void runPrePopActions() {
if (myPrePopActions != null) {
int iMax = myPrePopActions.size();
for (int i = iMax; i-- > 0; ) {
myPrePopActions.get(i).run();
}
}
}
@Override
public String toString() {
return "State{" +
"myParent=" + myParent +
", myElements=" + myElements +
", myIndex=" + myIndex +
", myAttributes=" + myAttributes +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy