| Method from org.dom4j.io.ElementStack Detail: |
public void addHandler(String path,
ElementHandler elementHandler) {
this.handler.addHandler(getHandlerPath(path), elementHandler);
}
|
public void clear() {
lastElementIndex = -1;
}
Peeks at the top element on the stack without changing the contents of
the stack. |
public boolean containsHandler(String path) {
return this.handler.containsHandler(path);
}
|
public Element getCurrent() {
return peekElement();
}
|
public DispatchHandler getDispatchHandler() {
return this.handler;
}
|
public Element getElement(int depth) {
Element element;
try {
element = (Element) stack[depth];
} catch (ArrayIndexOutOfBoundsException e) {
element = null;
}
return element;
}
|
public String getPath() {
if (handler == null) {
setDispatchHandler(new DispatchHandler());
}
return handler.getPath();
}
|
public Element peekElement() {
if (lastElementIndex < 0) {
return null;
}
return stack[lastElementIndex];
}
Peeks at the top element on the stack without changing the contents of
the stack. |
public Element popElement() {
if (lastElementIndex < 0) {
return null;
}
return stack[lastElementIndex--];
}
Pops the element off the stack |
public void pushElement(Element element) {
int length = stack.length;
if (++lastElementIndex >= length) {
reallocate(length * 2);
}
stack[lastElementIndex] = element;
}
Pushes a new element onto the stack |
protected void reallocate(int size) {
Element[] oldStack = stack;
stack = new Element[size];
System.arraycopy(oldStack, 0, stack, 0, oldStack.length);
}
Reallocates the stack to the given size |
public void removeHandler(String path) {
this.handler.removeHandler(getHandlerPath(path));
}
|
public void setDispatchHandler(DispatchHandler dispatchHandler) {
this.handler = dispatchHandler;
}
|
public int size() {
return lastElementIndex + 1;
}
|