view flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/meta/TypeConverter.java @ 417:e54053bc0e70

Implemented the input validation of WQ in the adapted WQ panel. flys-artifacts/trunk@1882 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 10 May 2011 15:28:30 +0000
parents 7c018f466d6d
children
line wrap: on
line source
package de.intevation.flys.artifacts.services.meta;

public class TypeConverter
{
    private TypeConverter() {
    }

    public static Object convert(Object object, String type) {

        if (type == null) {
            return object;
        }

        if ("Integer".equals(type)) {
            return Integer.valueOf(object.toString());
        }

        if ("Double".equals(type)) {
            return Double.valueOf(object.toString());
        }

        if ("String".equals(type)) {
            return object.toString();
        }

        // TODO: Add more types

        return object;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org