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

ar.com.fdvs.dj.core.FieldMapWrapper Maven / Gradle / Ivy

Go to download

DynamicJasper (DJ) is an API that hides the complexity of Jasper Reports, it helps developers to save time when designing simple/medium complexity reports generating the layout of the report elements automatically. It creates reports dynamically, defining at runtime the columns, column width (auto width), groups, variables, fonts, charts, crosstabs, sub reports (that can also be dynamic), page size and everything else that you can define at design time. DJ keeps full compatibility with Jasper Reports since it's a tool that helps create reports programmatically in a easy way (it only interferes with the creation of the report design doing the layout of the elements). You can use the classic .jrxml files as templates while the content and layout of the report elements are handled by the DJ API. http://dynamicjasper.com

There is a newer version: 5.3.9
Show newest version
package ar.com.fdvs.dj.core;

import net.sf.jasperreports.engine.fill.JRFillField;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

public class FieldMapWrapper implements Map {

    protected Map map;

    public FieldMapWrapper(Map map) {
        this.map = map;
    }

    public FieldMapWrapper() {
        this.map = Collections.emptyMap();
    }

    public void clear() {
        map.clear();
    }

    public boolean containsKey(Object key) {
        return map.containsKey(key);
    }

    public boolean containsValue(Object value) {
        throw new DJException("Method not implemented");
    }

    public Set entrySet() {
        return map.entrySet();
    }

    public boolean equals(Object o) {
        return map.equals(o);
    }

    public Object get(Object key) {
        Object value = map.get(key);
        if (value == null)
            return null;

        return ((JRFillField) value).getValue();
    }

    public int hashCode() {
        return map.hashCode();
    }

    public boolean isEmpty() {
        return map.isEmpty();
    }

    public Set keySet() {
        return map.keySet();
    }

    public Object put(Object arg0, Object arg1) {
        return map.put((String)arg0, (JRFillField)arg1);
    }

    public void putAll(Map arg0) {
        map.putAll(arg0);
    }

    public Object remove(Object key) {
        return map.remove(key);
    }

    public int size() {
        return map.size();
    }

    public Collection values() {
        throw new DJException("Method not implemented");
    }

    public void setMap(Map fldsm) {
        this.map = fldsm;
    }


    public Map getPreviousValues() {
        return new PreviousValuesMap(this);
    }

    class PreviousValuesMap extends FieldMapWrapper {

        public PreviousValuesMap(FieldMapWrapper fieldMapWrapper) {
            this.map = fieldMapWrapper.map;
        }

        @Override
        public Object get(Object key) {
            Object value = map.get(key);
            if (value == null)
                return null;

            return ((JRFillField) value).getOldValue();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy