// Path: src/main/java/com/modelsolv/kaboom/model/canonical/CDMProperty.java
// public interface CDMProperty extends ReadableCDMProperty {
// 
// 	public void setName(String name);
// 	
// 	public void setCardinality(Cardinality cardinality);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/RDMProperty.java
// public interface RDMProperty extends ReadableCDMProperty {
// 	
// 	public CDMProperty getCDMProperty();
// 	
// 	public void setCDMProperty(CDMProperty property);
// 	
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/object/CanonicalObjectReader.java
// public interface CanonicalObjectReader {
// 	
// 	public Object getPropertyValue(Object obj, CDMProperty prop);
// 	
// 	public Object getPropertyValue(Object obj, RDMProperty prop);
// 	
// 	public Object getPropertyValue(Object obj, String propName);
// }


import com.modelsolv.kaboom.object.CanonicalObjectReader;
import org.apache.commons.beanutils.PropertyUtils;
import com.modelsolv.kaboom.model.canonical.CDMProperty;
import com.modelsolv.kaboom.model.resource.RDMProperty;
/*******************************************************************************
 * Copyright (c) 2014 ModelSolv, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     ModelSolv, Inc. - initial API and implementation.
 *******************************************************************************/
package com.modelsolv.kaboom.object.beanImpl;



/**
 * A wrapper around a Java Bean that exposes the CanonicalObject interface.
 * Accesses properties reflectively, and adapts references recursively.
 * 
 * @author Ted
 * 
 */
public class CanonicalObjectBeanReader implements CanonicalObjectReader {

	@Override
	public Object getPropertyValue(Object obj, RDMProperty prop) {
		return getPropertyValue(obj, prop.getName());
	}

	@Override
	public Object getPropertyValue(Object obj, CDMProperty prop) {
		return getPropertyValue(obj, prop.getName());
	}

// Path: src/main/java/com/modelsolv/kaboom/model/canonical/CDMProperty.java
// public interface CDMProperty extends ReadableCDMProperty {
// 
// 	public void setName(String name);
// 	
// 	public void setCardinality(Cardinality cardinality);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/RDMProperty.java
// public interface RDMProperty extends ReadableCDMProperty {
// 	
// 	public CDMProperty getCDMProperty();
// 	
// 	public void setCDMProperty(CDMProperty property);
// 	
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/object/CanonicalObjectReader.java
// public interface CanonicalObjectReader {
// 	
// 	public Object getPropertyValue(Object obj, CDMProperty prop);
// 	
// 	public Object getPropertyValue(Object obj, RDMProperty prop);
// 	
// 	public Object getPropertyValue(Object obj, String propName);
// }


// Path: src/main/java/com/modelsolv/kaboom/object/beanImpl/CanonicalObjectBeanReader.java
import com.modelsolv.kaboom.object.CanonicalObjectReader;
import org.apache.commons.beanutils.PropertyUtils;
import com.modelsolv.kaboom.model.canonical.CDMProperty;
import com.modelsolv.kaboom.model.resource.RDMProperty;

/*******************************************************************************
 * Copyright (c) 2014 ModelSolv, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     ModelSolv, Inc. - initial API and implementation.
 *******************************************************************************/
package com.modelsolv.kaboom.object.beanImpl;



/**
 * A wrapper around a Java Bean that exposes the CanonicalObject interface.
 * Accesses properties reflectively, and adapts references recursively.
 * 
 * @author Ted
 * 
 */
public class CanonicalObjectBeanReader implements CanonicalObjectReader {

	@Override
	public Object getPropertyValue(Object obj, RDMProperty prop) {
		return getPropertyValue(obj, prop.getName());
	}

	@Override
	public Object getPropertyValue(Object obj, CDMProperty prop) {
		return getPropertyValue(obj, prop.getName());
	}

	@Override