kz.greetgo.msoffice.xlsx.parse.XmlIn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greetgo.msoffice Show documentation
Show all versions of greetgo.msoffice Show documentation
greetgo library to generate or parse MS Office files
package kz.greetgo.msoffice.xlsx.parse;
import java.util.LinkedList;
public class XmlIn {
private LinkedList inPath = new LinkedList();
public void stepIn(String name) {
inPath.add(name);
chachedCurrent = null;
}
public void stepOut() {
inPath.removeLast();
chachedCurrent = null;
}
private String chachedCurrent = null;
public String current() {
if (chachedCurrent != null) return chachedCurrent;
StringBuilder sb = new StringBuilder();
for (String name : inPath) {
if (sb.length() > 0) sb.append('/');
sb.append(name);
}
return chachedCurrent = sb.toString();
}
}