@OpenApiAll public class InstanceSpecificationHelper extends ClassifierHelper
ClassifierHelper.ElementsGetter<T>, ClassifierHelper.PropertyValueGetter, ClassifierHelper.PureAttributesGetter, ClassifierHelper.ShortElementNameResolver
Constructor and Description |
---|
InstanceSpecificationHelper() |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<InstanceSpecification> |
collectAllInstances(Classifier classifier,
java.util.Collection<InstanceSpecification> result)
Collect all instances of given classifier.
|
static Slot |
createSlot(InstanceSpecification instance,
Property property,
boolean createDefaultValue)
Creates slot for property
|
static void |
createSlotsForDefaultValues(InstanceSpecification instance,
boolean createAll)
Creates slots for properties of all assigned classifiers to instance.
|
static void |
createSlotsForDefaultValues(InstanceSpecification instance,
Classifier classifier,
boolean createAll)
Creates slots for properties of given classifier.
|
static Slot |
findSlot(InstanceSpecification instanceSpecification,
Property property)
Looks for existing slot for a given property in given instance.
|
static java.util.List<Association> |
getAssignableAssociationsForLink(InstanceSpecification clientInstance,
InstanceSpecification supplierInstance)
Gets available associations which are allowed to assign for a link.
|
static java.util.Collection<Association> |
getAssociationOfLink(InstanceSpecification instance)
Gets Association classifier from Link InstanceSpecification, if exists.
|
static java.util.Collection<InstanceSpecification> |
getLinksBetweenInstances(InstanceSpecification client,
InstanceSpecification supplier)
Returns links found between client and supplier instances
|
static Slot |
getSlot(InstanceSpecification instance,
Property property,
boolean createSlotIfNotExists)
Returns existing of creates a new Slot for the given property.
|
static Slot |
getSlot(InstanceSpecification instance,
Property property,
boolean createSlotIfNotExists,
boolean createDefaultValue)
Returns existing of creates a new Slot for the given property
|
static java.lang.Object |
getValueBySlot(Slot slot)
Retrieves values of slots as object, not as ValueSpecifications.
|
static boolean |
isInstanceSpecificationCompatibleWithType(Classifier type,
InstanceSpecification instance)
Checks if given instance specification is compatible with given Type.
|
static boolean |
isInstanceSpecificationCompatibleWithType(Classifier type,
InstanceSpecification instance,
boolean checkInherited)
Checks if given instance specification is compatible with given Type.
|
static boolean |
isLink(InstanceSpecification instance)
Checks if InstanceSpecification is Link.
|
static void |
setClassifierForInstanceSpecification(Classifier classifier,
InstanceSpecification instance,
boolean createSlots)
Set classifier for instance
|
static void |
setClassifierForInstanceSpecification(java.util.Collection<? extends Classifier> classifiers,
InstanceSpecification instance,
boolean createSlots)
Set classifiers for instance
|
static void |
setSlotValue(Slot slot,
java.lang.String value)
Set slot value from a given string.
|
areEqualParameterTypes, areEqualParameterTypes, associations, associationsIncludingInherited, attributes, checkForDerivedClassifier, collectBaseClassAttributes, collectBaseClassAttributes, collectBaseClassInheritableAttributes, collectBaseClassOperations, collectBaseClassPorts, collectCommonAssociations, collectDerivedClassifiersRecursivelly, collectDerivedClassifiersRecursively, collectGeneralClassifiersAndRealizedInterfacesRecursively, collectGeneralClassifiersRecursivelly, collectGeneralClassifiersRecursively, collectInheritedAttributes, collectInheritedBehaviors, collectInheritedElements, collectInheritedEnumerationLiterals, collectInheritedExtensionPoints, collectInheritedOperations, collectInheritedPorts, collectInheritedPureAttributes, collectInheritedPureAttributes, collectInheritedRealizedInterfaces, collectInheritedReceptions, collectInheritedRelations, collectRealizedInterfaces, findAssociationEndForType, findDataTypeFor, findGeneralization, findInterfaceRealization, getAllLiterals, getAssociationEndOwnedByAssociation, getAssociationEnds, getClassifierFor, getClassifierFor, getClassifierFor, getDerivedClassifiers, getDerivedClassifiers, getDerivedClassifiersRecursivelly, getDerivedClassifiersRecursively, getDerivedClassifiersRecursively, getGeneralClassifiers, getGeneralClassifiersRecursivelly, getGeneralClassifiersRecursivelly, getGeneralClassifiersRecursively, getGeneralClassifiersRecursively, getImplementedClasses, getInheritanceDeep, getOptimizedClassifierHierarchy, getParameters, getPropertiesWithoutRedefined, getProvided, getRealizedInterfaces, getReturnParameter, getReturnParameter, getReturnParameter, getReturnParameters, isBehavioralFeatureEqual, isClassifierOfType, isClassifierOfType, isDerivedClassifier, isDerivedOrRealizes, isLegalInheritance, isLegalInheritance, isLegalInterfaceRealization, isOperationEqual, isReturnParameter, isSameOrRedefined, isSecondTypeCompatibleToFirst, isSecondTypeCompatibleToFirst, operations, ports, pureAttributes, receptions, removeDerivedClassifiers, removeRedefined
cloneValueSpecification, createValueSpecification, createValueSpecification, createValueSpecification, createValueSpecification, createValueSpecification, getValueSpecificationClass, getValueSpecificationClass, getValueSpecificationValue, getValueString, setValueSpecificationValue, setValueSpecificationValue, setValueSpecificationValue
areElementsEditable, canAddChild, canAssignName, canAssignName, canAssignName, canMoveChildInto, canMoveChildInto, dispose, findAcceptableParentFor, findAcceptableParentFor, findOwnerOfStrictType, findOwnerOfStrictTypeIncludingItself, findOwnerOfType, findOwnerOfTypeIncludingItself, findParent, findParent, findParentOfType, getAdditionalElementsIterator, getClientElement, getComment, getCommentElement, getCommentElementOrCreate, getDependentClients, getDependentSuppliers, getFirstMemberEnd, getMultiplicity, getName, getOppositeEnd, getOwnedElementsIncludingAdditional, getSecondMemberEnd, getSupplierElement, getSupplierElement, getSupplierElements, hasParentIn, isChildOf, isDocumentationComment, isMultiplicityMany, isParentOf, isParentOf, isRelationship, isRelationshipAlwaysInClient, parseMultiplicityString, setClientElement, setComment, setCommentElement, setConstraintText, setMultiplicity, setMultiplicity, setSupplierElement
@CheckForNull public static Slot findSlot(InstanceSpecification instanceSpecification, Property property)
instanceSpecification
- instanceproperty
- definingFeature of slot@CheckForNull public static Slot getSlot(InstanceSpecification instance, Property property, boolean createSlotIfNotExists)
instance
- instance specificationproperty
- featurecreateSlotIfNotExists
- create a new slot if needed@CheckForNull public static Slot getSlot(InstanceSpecification instance, Property property, boolean createSlotIfNotExists, boolean createDefaultValue)
instance
- instance specificationproperty
- featurecreateSlotIfNotExists
- create a new slot if neededcreateDefaultValue
- fill slot value from property default valuepublic static void createSlotsForDefaultValues(InstanceSpecification instance, boolean createAll)
instance
- instancecreateAll
- true, if creates slots for all properties (do not check multiplicity). False, if create slots for properties which has lower multiplicity>=1.public static void createSlotsForDefaultValues(InstanceSpecification instance, Classifier classifier, boolean createAll)
instance
- instanceclassifier
- classifiercreateAll
- true, if creates slots for all properties (do not check multiplicity). False, if create slots for properties which has lowe multiplicity >=1.public static Slot createSlot(InstanceSpecification instance, Property property, boolean createDefaultValue)
instance
- instanceproperty
- propertycreateDefaultValue
- fill slot value from property default valuepublic static void setSlotValue(Slot slot, @CheckForNull java.lang.String value)
slot
- slotvalue
- value string representation.@CheckForNull public static java.lang.Object getValueBySlot(@CheckForNull Slot slot)
slot
- slotpublic static void setClassifierForInstanceSpecification(Classifier classifier, InstanceSpecification instance, boolean createSlots)
classifier
- classifierinstance
- instancecreateSlots
- true if slots needs to be createdpublic static void setClassifierForInstanceSpecification(@CheckForNull java.util.Collection<? extends Classifier> classifiers, InstanceSpecification instance, boolean createSlots)
classifiers
- classifiersinstance
- instancecreateSlots
- true if slots needs to be createdcreateSlotsForDefaultValues(InstanceSpecification, boolean)
public static java.util.List<Association> getAssignableAssociationsForLink(InstanceSpecification clientInstance, InstanceSpecification supplierInstance)
clientInstance
- client instance specificationsupplierInstance
- supplier instance specificationpublic static boolean isLink(@CheckForNull InstanceSpecification instance)
instance
- instance to checkpublic static java.util.Collection<InstanceSpecification> collectAllInstances(Classifier classifier, java.util.Collection<InstanceSpecification> result)
classifier
- classifierresult
- result collectionpublic static boolean isInstanceSpecificationCompatibleWithType(Classifier type, InstanceSpecification instance)
type
- instance compatibility will be checked against this typeinstance
- instance to checkpublic static boolean isInstanceSpecificationCompatibleWithType(Classifier type, InstanceSpecification instance, boolean checkInherited)
type
- instance compatibility will be checked against this typeinstance
- instance to checkcheckInherited
- if set to true, parent type will be treated as compatible.public static java.util.Collection<Association> getAssociationOfLink(InstanceSpecification instance)
instance
- Link instancepublic static java.util.Collection<InstanceSpecification> getLinksBetweenInstances(InstanceSpecification client, InstanceSpecification supplier)
client
- instancesupplier
- instance