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

org.jresearch.flexess.client.impl.GenericCheckerFlow Maven / Gradle / Ivy

The newest version!
package org.jresearch.flexess.client.impl;

import java.util.Map;

import org.eclipse.emf.ecore.EObject;
import org.jresearch.flexess.client.UamClientException;
import org.jresearch.flexess.client.mappers.IInstanceMapper;
import org.jresearch.flexess.client.mappers.impl.GenericMapper;
import org.jresearch.flexess.core.model.uam.PObject;

public class GenericCheckerFlow implements ICheckerFlow {

	private final Map attributes;

	private final Class aClass;

	public GenericCheckerFlow(Map attr, Class objectClass) {
		attributes = attr;
		aClass = objectClass;
	}

	@Override
	public EObject getPOInstance(PObject po) {
		EObject eObject = null;
		try {
			IInstanceMapper mapper = new GenericMapper();
			eObject = mapper.createPObjectInstance(attributes, po);
		} catch (Exception e) {
			throw new UamClientException("Unable to create EObject", e);
		}
		return eObject;
	}

	@Override
	public Class getObjectClass() {
		return aClass;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy