// 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/canonical/CDMReferenceProperty.java
// public interface CDMReferenceProperty extends CDMProperty, ReadableCDMReferenceProperty {
// 	
// 	public void setTargetDataType(CanonicalDataType type);
// 	
// 	public CDMReferenceProperty withTargetDataType(CanonicalDataType type);
// 	
// 	public void setInverseProperty(CDMReferenceProperty inverse);
// 	
// 	public CDMReferenceProperty withInverseProperty(CDMReferenceProperty inverse);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ObjectResourceDefinition.java
// public interface ObjectResourceDefinition extends ResourceDefinition {
// 
// 	// write-once properties, should be passed in ctor
// 	public String getURITemplate();
// 
// 	/**
// 	 * @return the ResourceDataModel bound to this class of resources.
// 	 */
// 	public ResourceDataModel getResourceDataModel();
// 
// 	// read-writable properties
// 
// 	public String getName();
// 
// 	public void setName(String name);
// 
// 	public ObjectResourceDefinition withName(String name);
// 
// 	public void bindTemplateParameter(String parameter, CDMProperty property);
// 	
// 	public ObjectResourceDefinition withTemplateParameter(String parameter, CDMProperty property);
// 
// 	/**
// 	 * Factory method to create or retrieve an individual Resource bound to the
// 	 * canonicalObject. The canonicalObject must confirm to the
// 	 * ResourceDataModel. This method is responsible for populating the resource
// 	 * URI and any other required properties of the Resource.
// 	 * 
// 	 * @param canonicalObject
// 	 * @return
// 	 */
// 	public ObjectResource getResource(Object canonicalObject, CanonicalObjectReader reader);
// 
// }
// 
// 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/model/resource/ReferenceLink.java
// public interface ReferenceLink extends RDMReferenceProperty {
// 
// 	/**
// 	 * The list of included "decorator" properties included in the
// 	 * ReferenceLink. These may be defined directly in the ReferenceLink, or in
// 	 * a named LinkDescriptor.
// 	 * 
// 	 * @return
// 	 */
// 	public Iterable<RDMProperty> getIncludedProperties();
// 
// 	public ReferenceLink includingProperties(CDMProperty... properties);
// 	
// 	public ReferenceLink includingProperties(String... properties);
// 	
// 	/**
// 	 * Return true if the ReferenceLink has one or more included properties.
// 	 */
// 	public boolean isDecorated();
// 
// 	/**
// 	 * 
// 	 * @return the Link Relation if specified, otherwise null
// 	 */
// 	public String getLinkRelation();
// 	
// 	public void setLinkRelation(String linkRelation);
// 	
// 	public ReferenceLink withLinkRelation(String linkRelation);
// 
// 	/**
// 	 * The target resource of the link. Will be the default resource for the
// 	 * referenced data type, unless it's overridden in the ReferenceLink
// 	 * definition.
// 	 * 
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getTargetResourceDefinition();
// 	
// 	public void setTargetResourceDefinition(ObjectResourceDefinition resourceDef);
// 	
// 	public ReferenceLink withTargetResourceDefinition(ObjectResourceDefinition resourceDef);
// 	
// }


import com.modelsolv.kaboom.model.canonical.CDMProperty;
import com.modelsolv.kaboom.model.canonical.CDMReferenceProperty;
import com.modelsolv.kaboom.model.resource.ObjectResourceDefinition;
import com.modelsolv.kaboom.model.resource.RDMProperty;
import com.modelsolv.kaboom.model.resource.ReferenceLink;
/*******************************************************************************
 * 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.model.resource.nativeImpl;


public class ReferenceLinkImpl extends RDMReferencePropertyImpl implements
		ReferenceLink {

	private RDMPropertyCollection includedProperties = new RDMPropertyCollection();

	private String linkRelation;

	private ObjectResourceDefinition targetResource;

	public ReferenceLinkImpl(CDMReferenceProperty property) {
		super(property);
	}

	@Override
	public Iterable<RDMProperty> getIncludedProperties() {
		return includedProperties;
	}

	@Override
	public String getLinkRelation() {
		return linkRelation;
	}

	@Override
	public ReferenceLink includingProperties(CDMProperty... properties) {
		includedProperties.withProperties(properties);
		return this;
	}

	@Override
	public ReferenceLink includingProperties(String... properties) {
		includedProperties.withProperties(getTargetDataType(), properties);
		return null;
	}

	@Override
	public void setLinkRelation(String linkRelation) {
// 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/canonical/CDMReferenceProperty.java
// public interface CDMReferenceProperty extends CDMProperty, ReadableCDMReferenceProperty {
// 	
// 	public void setTargetDataType(CanonicalDataType type);
// 	
// 	public CDMReferenceProperty withTargetDataType(CanonicalDataType type);
// 	
// 	public void setInverseProperty(CDMReferenceProperty inverse);
// 	
// 	public CDMReferenceProperty withInverseProperty(CDMReferenceProperty inverse);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ObjectResourceDefinition.java
// public interface ObjectResourceDefinition extends ResourceDefinition {
// 
// 	// write-once properties, should be passed in ctor
// 	public String getURITemplate();
// 
// 	/**
// 	 * @return the ResourceDataModel bound to this class of resources.
// 	 */
// 	public ResourceDataModel getResourceDataModel();
// 
// 	// read-writable properties
// 
// 	public String getName();
// 
// 	public void setName(String name);
// 
// 	public ObjectResourceDefinition withName(String name);
// 
// 	public void bindTemplateParameter(String parameter, CDMProperty property);
// 	
// 	public ObjectResourceDefinition withTemplateParameter(String parameter, CDMProperty property);
// 
// 	/**
// 	 * Factory method to create or retrieve an individual Resource bound to the
// 	 * canonicalObject. The canonicalObject must confirm to the
// 	 * ResourceDataModel. This method is responsible for populating the resource
// 	 * URI and any other required properties of the Resource.
// 	 * 
// 	 * @param canonicalObject
// 	 * @return
// 	 */
// 	public ObjectResource getResource(Object canonicalObject, CanonicalObjectReader reader);
// 
// }
// 
// 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/model/resource/ReferenceLink.java
// public interface ReferenceLink extends RDMReferenceProperty {
// 
// 	/**
// 	 * The list of included "decorator" properties included in the
// 	 * ReferenceLink. These may be defined directly in the ReferenceLink, or in
// 	 * a named LinkDescriptor.
// 	 * 
// 	 * @return
// 	 */
// 	public Iterable<RDMProperty> getIncludedProperties();
// 
// 	public ReferenceLink includingProperties(CDMProperty... properties);
// 	
// 	public ReferenceLink includingProperties(String... properties);
// 	
// 	/**
// 	 * Return true if the ReferenceLink has one or more included properties.
// 	 */
// 	public boolean isDecorated();
// 
// 	/**
// 	 * 
// 	 * @return the Link Relation if specified, otherwise null
// 	 */
// 	public String getLinkRelation();
// 	
// 	public void setLinkRelation(String linkRelation);
// 	
// 	public ReferenceLink withLinkRelation(String linkRelation);
// 
// 	/**
// 	 * The target resource of the link. Will be the default resource for the
// 	 * referenced data type, unless it's overridden in the ReferenceLink
// 	 * definition.
// 	 * 
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getTargetResourceDefinition();
// 	
// 	public void setTargetResourceDefinition(ObjectResourceDefinition resourceDef);
// 	
// 	public ReferenceLink withTargetResourceDefinition(ObjectResourceDefinition resourceDef);
// 	
// }


// Path: src/main/java/com/modelsolv/kaboom/model/resource/nativeImpl/ReferenceLinkImpl.java
import com.modelsolv.kaboom.model.canonical.CDMProperty;
import com.modelsolv.kaboom.model.canonical.CDMReferenceProperty;
import com.modelsolv.kaboom.model.resource.ObjectResourceDefinition;
import com.modelsolv.kaboom.model.resource.RDMProperty;
import com.modelsolv.kaboom.model.resource.ReferenceLink;

/*******************************************************************************
 * 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.model.resource.nativeImpl;


public class ReferenceLinkImpl extends RDMReferencePropertyImpl implements
		ReferenceLink {

	private RDMPropertyCollection includedProperties = new RDMPropertyCollection();

	private String linkRelation;

	private ObjectResourceDefinition targetResource;

	public ReferenceLinkImpl(CDMReferenceProperty property) {
		super(property);
	}

	@Override
	public Iterable<RDMProperty> getIncludedProperties() {
		return includedProperties;
	}

	@Override
	public String getLinkRelation() {
		return linkRelation;
	}

	@Override
	public ReferenceLink includingProperties(CDMProperty... properties) {
		includedProperties.withProperties(properties);
		return this;
	}

	@Override
	public ReferenceLink includingProperties(String... properties) {
		includedProperties.withProperties(getTargetDataType(), properties);
		return null;
	}

	@Override
	public void setLinkRelation(String linkRelation) {
		this.linkRelation = linkRelation;