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

org.hibernate.tool.hbm2x.ExporterProvider Maven / Gradle / Ivy

There is a newer version: 5.6.15.Final
Show newest version
package org.hibernate.tool.hbm2x;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.hibernate.internal.util.ReflectHelper;

public class ExporterProvider {
	
	final String exporterClassName;
	final String exporterName;
	final Map supportedProperties;
	
	public ExporterProvider(String exporterName, String exporterClassName, Map supportedProperties) {
		this.exporterClassName = exporterClassName;
		this.exporterName = exporterName;
		this.supportedProperties = supportedProperties;
	}
	
	public String getExporterName() {
		return exporterName;
	}
	
	public Set getSupportedProperties() {
		return supportedProperties.keySet();
	}
	
	public List validateProperties(Properties properties) {
		return Collections.EMPTY_LIST;
	}
	
	public Exporter createProvider() {
		try {
			return (Exporter) ReflectHelper.classForName(exporterClassName, this.getClass()).newInstance();
		}
		catch (Exception e) {
			throw new ExporterException("Could not create exporter: " + exporterClassName, e);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy