Package org.cristalise.kernel.collection
Class DependencyMember
java.lang.Object
org.cristalise.kernel.collection.DependencyMember
- All Implemented Interfaces:
CollectionMember
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignItem(ItemPath itemPath, TransactionKey transactionKey) Assign the given item to the slot, if it fitsvoidDe-assign the slot, leaving it empty.booleanconvertToItemPropertyByScript(PropertyArrayList props, TransactionKey transactionKey) Executes Script if it was defined in the Member propertiesprotected ObjectevaluateScript(TransactionKey transactionKey) Returns the UUID of the currently assigned ItemGets the class properties, which specify type information in child Items.intgetID()Get the integer slot ID, as generated by the parent CollectionReturns the current assigned ItemPathGets the member properties.getProperty(String prop) resolveItem(TransactionKey transactionKey) Resolve the Item currently assignedvoidsetBuiltInProperty(BuiltInVertexProperties prop, Object val) voidsetChildUUID(String uuid) voidsetClassProps(String props) voidsetID(int id) voidsetKeyValuePairs(KeyValuePair[] pairs) voidsetProperties(CastorHashMap props) voidsetProperty(String prop, Object val) voidupdatePropertieFromDescription(CastorHashMap propDesc, DependencyMember newMember) voidupdateProperties(CastorHashMap newProps) Only update existing properties otherwise throw an exception
-
Constructor Details
-
DependencyMember
public DependencyMember()
-
-
Method Details
-
getItemPath
Description copied from interface:CollectionMemberReturns the current assigned ItemPath- Specified by:
getItemPathin interfaceCollectionMember- Returns:
- the ItemPath, null if empty
-
setProperties
-
getProperties
Description copied from interface:CollectionMemberGets the member properties.- Specified by:
getPropertiesin interfaceCollectionMember- Returns:
- CastorHashMap
-
getKeyValuePairs
-
setKeyValuePairs
-
getID
public int getID()Description copied from interface:CollectionMemberGet the integer slot ID, as generated by the parent Collection- Specified by:
getIDin interfaceCollectionMember- Returns:
- ID
-
setID
public void setID(int id) -
setClassProps
-
getClassProps
Description copied from interface:CollectionMemberGets the class properties, which specify type information in child Items. On instantiation from a CollectionDescription, the ClassProps are generated from the PropertyDescriptions which have the isClassIdentifier boolean set to true.- Specified by:
getClassPropsin interfaceCollectionMember- Returns:
- Comma-separated list of property names that relate to Item type
-
assignItem
public void assignItem(ItemPath itemPath, TransactionKey transactionKey) throws InvalidCollectionModification Description copied from interface:CollectionMemberAssign the given item to the slot, if it fits- Specified by:
assignItemin interfaceCollectionMember- Parameters:
itemPath- The item to assign- Throws:
InvalidCollectionModification- When the Item Properties don't match the typing specification in ClassProps and Properties
-
clearItem
public void clearItem()Description copied from interface:CollectionMemberDe-assign the slot, leaving it empty.- Specified by:
clearItemin interfaceCollectionMember
-
resolveItem
Description copied from interface:CollectionMemberResolve the Item currently assigned- Specified by:
resolveItemin interfaceCollectionMember- Returns:
- the ItemProxy of the assigned Item
- Throws:
ObjectNotFoundException- When empty
-
setChildUUID
public void setChildUUID(String uuid) throws InvalidCollectionModification, InvalidItemPathException -
getChildUUID
Description copied from interface:CollectionMemberReturns the UUID of the currently assigned Item- Specified by:
getChildUUIDin interfaceCollectionMember- Returns:
- UUID
-
getProperty
-
setProperty
-
getBuiltInProperty
-
setBuiltInProperty
-
evaluateScript
protected Object evaluateScript(TransactionKey transactionKey) throws InvalidDataException, ObjectNotFoundException - Returns:
- either PropertyArrayList or CastorHashMap
- Throws:
InvalidDataExceptionObjectNotFoundException
-
updatePropertieFromDescription
public void updatePropertieFromDescription(CastorHashMap propDesc, DependencyMember newMember) throws ObjectNotFoundException, InvalidCollectionModification - Parameters:
propDesc-newMember-- Throws:
ObjectNotFoundExceptionInvalidCollectionModification
-
updateProperties
public void updateProperties(CastorHashMap newProps) throws ObjectNotFoundException, InvalidCollectionModification Only update existing properties otherwise throw an exception- Parameters:
newProps- the new properties- Throws:
ObjectNotFoundException- property does not exists for memberInvalidCollectionModification- cannot update class properties
-
convertToItemPropertyByScript
public boolean convertToItemPropertyByScript(PropertyArrayList props, TransactionKey transactionKey) throws InvalidDataException, ObjectNotFoundException Executes Script if it was defined in the Member properties- Parameters:
props- the current list of ItemPropertiesmember- the current DependencyMember- Returns:
- true when Script was executed
- Throws:
InvalidDataExceptionObjectNotFoundException
-