All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nomin.util.SimpleConversionClosure Maven / Gradle / Ivy

Go to download

Nomin is a mapping engine for the Java platform. It provides abilities to transform object trees according to declarative mapping rules. Main features of Nomin are no XML configuration, intuitively looking mapping, using arbitrary expressions and method invocations in mappings, pre and postprocessing right in a mapping listing, customizations. It's applicable for any Java compatible classes, not only JavaBeans.

There is a newer version: 1.2.2
Show newest version
package org.nomin.util;

import java.util.Map;
import groovy.lang.Closure;

/**
 * Performs simple conversions using supplied map with values.
 * @author Dmitry Dobrynin
 *         Created 26.05.2010 12:44:25
 */
public class SimpleConversionClosure extends Closure {
    private Map variants;

    public SimpleConversionClosure(Map variants) {
        super(null, null);
        this.variants = variants;
    }

    public Object call(Object[] args) { return variants.get(args[0]); }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy