view geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/DefaultQueryContainer.java @ 1145:dfe1ac687c7f tip

added tags
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:16:15 +0200
parents ebeb56428409
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

package de.intevation.gnv.geobackend.base.query.container;

import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException;

import java.util.Properties;

/**
 * Defaultimplementation of an QueryContainer.
 * All Queries are provided using a Propertiescontainer.
 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
 */
public class DefaultQueryContainer implements QueryContainer {

    /**
     * The Properties-Object all Queries are provided in.
     */
    private Properties queries = null;

    /**
     * Constructor
     */
    public DefaultQueryContainer() {
        super();
    }

    /**
     * @see de.intevation.gnv.geobackend.base.query.container.QueryContainer#getQuery(java.lang.String)
     */
    public String getQuery(String queryID) throws QueryContainerException {
        String returnValue = null;
        if (this.queries != null){
            returnValue = this.queries.getProperty(queryID);
        }
        return returnValue;
    }

    /**
     * @see de.intevation.gnv.geobackend.base.query.container.QueryContainer#initialize(java.util.Properties)
     */
    public void initialize(Properties properties) throws QueryContainerException {
        this.queries = properties;
    }

}

http://dive4elements.wald.intevation.org