package com.c2kernel.lifecycle.instance.predefined.entitycreation; import java.util.ArrayList; import com.c2kernel.collection.MembershipException; import com.c2kernel.lookup.DomainPath; import com.c2kernel.property.PropertyUtility; public class Dependency implements java.io.Serializable { public String name; public boolean isDescription; public String itemDescriptionPath; public ArrayList dependencyMemberList; public Dependency() { super(); dependencyMemberList = new ArrayList(); } public Dependency(String itemDesc) { this(); this.itemDescriptionPath = itemDesc; } /** * @return */ public com.c2kernel.collection.Dependency create() throws MembershipException{ com.c2kernel.collection.Dependency newDep = new com.c2kernel.collection.Dependency(name); if (itemDescriptionPath != null) { PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getSysKey()); //TODO: set props and class identifiers } for (DependencyMember thisMem : dependencyMemberList) { int syskey = new DomainPath(thisMem.itemPath).getSysKey(); if (syskey == -1) throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection."); newDep.addMember(syskey); } return newDep; } }