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

ar.com.fdvs.dj.core.ParameterMapWrapper 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.JRFillParameter;

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

public class ParameterMapWrapper implements Map {
	
	private Map map;
    private String reportName;

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

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

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

    public boolean containsKey(Object key) {
		boolean contains = map.containsKey(key);
		return contains || map.containsKey(reportName + "_" + 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){
            value = map.get(reportName + "_" + key);
        }
        if (value == null){
            return null;
        }

        return ((JRFillParameter)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, (JRFillParameter) 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 parsm) {
		this.map = parsm;
		
	}


    public void setReportName(String reportName) {
        this.reportName = reportName;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy