teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5994: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5994: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.access; sascha@3777: teichmann@5867: import org.dive4elements.river.artifacts.D4EArtifact; sascha@3777: felix@7261: import org.dive4elements.river.artifacts.model.RiverFactory; felix@7261: felix@7261: import org.dive4elements.river.model.River; felix@7261: sascha@3777: import org.apache.log4j.Logger; sascha@3777: felix@4118: /** Access to river data of an artifact. */ sascha@3777: public class RiverAccess sascha@3777: extends Access sascha@3777: { felix@4118: /** Private logger. */ sascha@3777: private static Logger log = Logger.getLogger(RiverAccess.class); sascha@3777: felix@4118: /** River name. */ sascha@3777: protected String river; sascha@3777: felix@4118: sascha@3777: public RiverAccess() { sascha@3777: } sascha@3777: teichmann@5867: public RiverAccess(D4EArtifact artifact) { sascha@3777: super(artifact); sascha@3777: } sascha@3777: felix@4118: felix@4118: /** Get River name. */ felix@7261: public String getRiverName() { sascha@3777: if (river == null) { sascha@3777: river = getString("river"); sascha@3777: } sascha@3777: if (log.isDebugEnabled()) { sascha@3777: log.debug("river: '" + river + "'"); sascha@3777: } sascha@3777: return river; sascha@3777: } felix@7261: felix@7261: public River getRiver() { felix@7261: getRiverName(); felix@7261: felix@7261: return (river != null) felix@7261: ? RiverFactory.getRiver(river) felix@7261: : null; felix@7261: } sascha@3777: } sascha@3777: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :