Package org.cristalise.kernel.collection
Interface CollectionMember
- All Known Implementing Classes:
AggregationMember,DependencyMember
public interface CollectionMember
CollectionMembers are pointers to individual Items in a collection. Under
certain circumstances they may be empty, or they can be created and destroyed
as required. They can hold properties containing annotations about the link,
including information on the typing of the Item they should point to.
Properties that dictate type information are specified in the ClassProps, and
assignment of an Item will fail if those member properties do not match the
Property values of the Item attempting to be assigned, throwing a detailing the mismatches.
-
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.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.resolveItem(TransactionKey transactionKey) Resolve the Item currently assigned
-
Method Details
-
getItemPath
ItemPath getItemPath()Returns the current assigned ItemPath- Returns:
- the ItemPath, null if empty
-
getChildUUID
String getChildUUID()Returns the UUID of the currently assigned Item- Returns:
- UUID
-
assignItem
void assignItem(ItemPath itemPath, TransactionKey transactionKey) throws InvalidCollectionModification Assign the given item to the slot, if it fits- Parameters:
itemPath- The item to assign- Throws:
InvalidCollectionModification- When the Item Properties don't match the typing specification in ClassProps and Properties
-
clearItem
void clearItem()De-assign the slot, leaving it empty. -
resolveItem
Resolve the Item currently assigned- Returns:
- the ItemProxy of the assigned Item
- Throws:
ObjectNotFoundException- When empty
-
getID
int getID()Get the integer slot ID, as generated by the parent Collection- Returns:
- ID
-
getProperties
CastorHashMap getProperties()Gets the member properties.- Returns:
- CastorHashMap
-
getClassProps
String getClassProps()Gets 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.- Returns:
- Comma-separated list of property names that relate to Item type
-