Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/EmptySettings.java @ 1979:a7c437c9547e
Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
flys-artifacts/trunk@3409 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 14 Dec 2011 10:20:56 +0000 |
parents | |
children | 3632150dbe0b |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/EmptySettings.java Wed Dec 14 10:20:56 2011 +0000 @@ -0,0 +1,68 @@ +package de.intevation.flys.exports; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +import de.intevation.artifactdatabase.state.Settings; +import de.intevation.artifactdatabase.state.Section; + + +/** + * An implementation of <i>Settings</i> that doesn't take new <i>Section</i>s + * and that always creates an empty <b>settings</b> DOM node in its + * <i>toXML()</i> operation. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class EmptySettings implements Settings { + + public EmptySettings() { + } + + + /** + * This method has no function. It is not implemented! + * + * @param section A Section. + */ + @Override + public void addSection(Section section) { + // do nothing + } + + + /** + * Always returns 0. + * + * @return 0. + */ + @Override + public int getSectionCount() { + return 0; + } + + + /** + * This method always returns null. It is not implemented! + * + * @param pos A position. + * + * @return null. + */ + @Override + public Section getSection(int pos) { + return null; + } + + + /** + * This method creates an empty <i>settings</i> DOM node. + * + * @param parent A parent DOM node. + */ + @Override + public void toXML(Node parent) { + Document owner = parent.getOwnerDocument(); + parent.appendChild(owner.createElement("art:settings")); + } +}