org.rhq.plugins.apache.parser.ApacheDirectiveStack Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhq-apache-plugin Show documentation
Show all versions of rhq-apache-plugin Show documentation
a plugin for managing Apache web servers (1.3 and later)
package org.rhq.plugins.apache.parser;
import java.util.ArrayList;
import java.util.List;
public class ApacheDirectiveStack {
protected List stack;
public ApacheDirectiveStack() {
stack = new ArrayList();
}
public void addDirective(ApacheDirective dir) {
stack.add(dir);
}
public ApacheDirective getLastDirective() {
return stack.get(stack.size() - 1);
}
public void removeLastDirective() {
stack.remove(stack.size() - 1);
}
public ApacheDirectiveStack copy() {
ApacheDirectiveStack st = new ApacheDirectiveStack();
for (ApacheDirective dir : stack) {
st.addDirective(dir);
}
return st;
}
public boolean isEmpty() {
if (stack.size() == 0)
return true;
else
return false;
}
}