ingo@1979: package de.intevation.flys.exports;
ingo@1979:
ingo@1979: import org.w3c.dom.Document;
ingo@1979: import org.w3c.dom.Node;
ingo@1979:
ingo@1979: import de.intevation.artifactdatabase.state.Settings;
ingo@1979: import de.intevation.artifactdatabase.state.Section;
ingo@1979:
ingo@1979:
ingo@1979: /**
ingo@1979: * An implementation of Settings that doesn't take new Sections
ingo@1979: * and that always creates an empty settings DOM node in its
ingo@1979: * toXML() operation.
ingo@1979: *
ingo@1979: * @author Ingo Weinzierl
ingo@1979: */
ingo@1979: public class EmptySettings implements Settings {
ingo@1979:
ingo@1979: public EmptySettings() {
ingo@1979: }
ingo@1979:
ingo@1979:
ingo@1979: /**
ingo@1979: * This method has no function. It is not implemented!
ingo@1979: *
ingo@1979: * @param section A Section.
ingo@1979: */
ingo@1979: @Override
ingo@1979: public void addSection(Section section) {
ingo@1979: // do nothing
ingo@1979: }
ingo@1979:
ingo@1979:
ingo@1979: /**
ingo@1979: * Always returns 0.
ingo@1979: *
ingo@1979: * @return 0.
ingo@1979: */
ingo@1979: @Override
ingo@1979: public int getSectionCount() {
ingo@1979: return 0;
ingo@1979: }
ingo@1979:
ingo@1979:
ingo@1979: /**
ingo@1979: * This method always returns null. It is not implemented!
ingo@1979: *
ingo@1979: * @param pos A position.
ingo@1979: *
ingo@1979: * @return null.
ingo@1979: */
ingo@1979: @Override
ingo@1979: public Section getSection(int pos) {
ingo@1979: return null;
ingo@1979: }
ingo@1979:
ingo@1979:
ingo@1979: /**
ingo@1986: * This method has no function. It is not implemented!
ingo@1986: */
ingo@1986: @Override
ingo@1986: public void removeSection(Section section) {
ingo@1986: // do nothing
ingo@1986: }
ingo@1986:
ingo@1986:
ingo@1986: /**
ingo@1979: * This method creates an empty settings DOM node.
ingo@1979: *
ingo@1979: * @param parent A parent DOM node.
ingo@1979: */
ingo@1979: @Override
ingo@1979: public void toXML(Node parent) {
ingo@1979: Document owner = parent.getOwnerDocument();
ingo@1986: parent.appendChild(owner.createElement("settings"));
ingo@1979: }
ingo@1979: }
sascha@3083: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :