teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5863: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5863: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.exports; ingo@1979: ingo@1979: import org.w3c.dom.Document; ingo@1979: import org.w3c.dom.Node; ingo@1979: teichmann@5831: import org.dive4elements.artifactdatabase.state.Settings; teichmann@5831: import org.dive4elements.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 :