@OpenApiAll public class ModelHelper extends InstanceSpecificationHelper
ClassifierHelper.PropertyValueGetter, ClassifierHelper.PureAttributesGetter| Constructor and Description |
|---|
ModelHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canAssignType(TypedElement typedElement,
Type type)
Check if given Type can be assigned to a given TypedElement.
|
static boolean |
canChangeNavigability(Property property)
Checks if navigability of the association end property can be inverted - navigable to
non-navigable and vice versa.
|
static boolean |
canChangeOwnerTo(Property property,
boolean toAssociation)
Checks if association end can be owned by association or connected element.
|
static void |
changeOwnerTo(Property property,
boolean toAssociation)
Changes ownership of the association end.
|
static Image |
createImage(ElementsFactory factory,
java.io.File file)
Creates image model element from a given image found in a file.
|
static Image |
createImage(ElementsFactory factory,
java.lang.String url)
Creates image model element from a given image found at url.
|
static Behavior |
findBehaviorFor(Element element)
Finds a defining behavior for a given element.
|
static Deployment |
findDeployment(DeploymentTarget deploymentTarget,
DeployedArtifact artifact)
Find existing deployment among target and artifact
|
static NamedElement |
findOwner(Property property,
boolean association)
Finds preferred owner element for the association end.
|
static java.util.List<ActivityParameterNode> |
getActivityParameterNodes(Activity activity)
Gets activity parameter nodes from a given activity.
|
static BehavioredClassifier |
getContext(Behavior behavior)
The classifier that is the context for the execution of the behavior.
|
static ConnectorEnd |
getFirstEnd(Connector connector)
Return a first connector end
|
static ConnectorEnd |
getOppositeEnd(ConnectorEnd end)
Gets opposite connector end for a given connector end.
|
static ConnectorEnd |
getSecondEnd(Connector connector)
Return a second connector end
|
static boolean |
isAggregation(Association association,
AggregationKind aggregationKind)
Determines if association is of specified aggregation kind.
|
static boolean |
isDirectedAssociation(Association association)
Check if association is directed
|
static boolean |
isNonNavigableAssociation(Association association)
Check if association is non navigable
|
static boolean |
isPropertyEqual(Property p1,
Property p2)
Compare the two given Property.
|
static void |
setNavigable(Property property,
boolean navigable)
Sets navigability of the specified association end.
|
static void |
setNavigable(Property property,
boolean navigable,
boolean automaticOwnership)
Sets navigability of the specified association end.
|
collectAllInstances, createSlot, createSlotsForDefaultValues, createSlotsForDefaultValues, findSlot, getAssignableAssociationsForLink, getAssociationOfLink, getLinksBetweenInstances, getNestedSlot, getSlot, getSlot, getValueBySlot, isInstanceSpecificationCompatibleWithType, isInstanceSpecificationCompatibleWithType, isLink, setClassifierForInstanceSpecification, setClassifierForInstanceSpecification, setSlotValueareEqualParameterTypes, areEqualParameterTypes, associations, associationsIncludingInherited, attributes, checkForDerivedClassifier, collectBaseClassInheritableAttributes, collectCommonAssociations, collectDerivedClassifiersRecursively, collectGeneralClassifiersAndRealizedInterfacesRecursively, collectGeneralClassifiersRecursively, collectInheritedAttributes, collectInheritedBehaviors, collectInheritedEnumerationLiterals, collectInheritedExtensionPoints, collectInheritedOperations, collectInheritedPorts, collectInheritedPureAttributes, collectInheritedPureAttributes, collectInheritedRealizedInterfaces, collectInheritedReceptions, collectInheritedRelations, collectRealizedInterfaces, findAssociationEndForType, findGeneralization, findInterfaceRealization, getAllLiterals, getAssociationEndOwnedByAssociation, getClassifiersIncludingDerived, getClassifiersIncludingDerivedRecursively, getClassifiersIncludingGeneralRecursively, getClassifiersIncludingGeneralRecursively, getDerivedClassifiers, getDerivedClassifiersRecursively, getGeneralClassifiers, getGeneralClassifiersRecursively, getImplementedClasses, getInheritanceDeep, getParameters, getPropertiesWithoutRedefined, getProvided, getRealizedInterfaces, getReturnParameter, getReturnParameter, getReturnParameter, getReturnParameters, isBehavioralFeatureEqual, isClassifierOfType, isClassifierOfType, isDerivedClassifier, isDerivedOrRealizes, isLegalInheritance, isLegalInheritance, isOperationEqual, isReturnParameter, isSameOrRedefined, isSecondTypeCompatibleToFirst, isSecondTypeCompatibleToFirst, operations, ports, pureAttributes, receptions, removeDerivedClassifiers, removeRedefinedcloneValueSpecification, createValueSpecification, createValueSpecification, createValueSpecification, createValueSpecification, createValueSpecification, getValueSpecificationClass, getValueSpecificationClass, getValueSpecificationValue, getValueString, isValueSpecificationClassElementValue, setValueDisposeIfNeeded, setValueSpecificationValue, setValueSpecificationValue, setValueSpecificationValueareElementsEditable, canAddChild, canAssignName, canAssignName, canAssignName, canMoveChildInto, canMoveChildInto, collectRelationships, collectRelationships, collectRelationshipsByType, collectRelationshipsIncludeIndirect, dispose, findAcceptableParentFor, findAcceptableParentFor, findOwnerOfStrictType, findOwnerOfStrictTypeIncludingItself, findOwnerOfType, findOwnerOfTypeIncludingItself, findParent, findParent, 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, setConstraintText, setMultiplicity, setMultiplicity, setSupplierElementpublic static java.util.List<ActivityParameterNode> getActivityParameterNodes(Activity activity)
activity - activity from which parameter nodes must be returned.public static Image createImage(ElementsFactory factory, java.io.File file)
file - file in which to look for an image.public static Image createImage(ElementsFactory factory, java.lang.String url)
url - urlpublic static boolean isPropertyEqual(Property p1, Property p2)
p1 - First propertyp2 - Second propertypublic static boolean canChangeNavigability(Property property)
property - association end, can not be nullpublic static void setNavigable(Property property, boolean navigable)
Example: Association assoc = ...; Property secondMemberEnd = ModelHelper.getSecondMemberEnd(assoc); ModelHelper.setNavigable(secondMemberEnd, secondMemberEnd.isNavigable());
property - association end. Can not be nullnavigable - flagpublic static void setNavigable(Property property, boolean navigable, boolean automaticOwnership)
property - association end. Can not be nullnavigable - flagautomaticOwnership - indicates if it should change association end ownership to connected element when its possiblepublic static boolean canChangeOwnerTo(Property property, boolean toAssociation)
property - association end. Can not be nulltoAssociation - indicates what kind of ownership shall be checked - true for association and false for connected elementpublic static void changeOwnerTo(Property property, boolean toAssociation)
property - association end. Can not be nulltoAssociation - preferred owner: true for association and false for connected elementpublic static NamedElement findOwner(Property property, boolean association)
property - association end. Can not be nullassociation - preferred owner: true for association and false for connected element@CheckForNull public static Behavior findBehaviorFor(Element element)
element - elementpublic static boolean isAggregation(Association association, AggregationKind aggregationKind)
association - association model element.aggregationKind - AggregationKindEnum.SHARED - aggregation, AggregationKindEnum.COMPOSITE - composition.public static boolean isDirectedAssociation(Association association)
association - associationpublic static boolean isNonNavigableAssociation(Association association)
association - association@CheckForNull public static Deployment findDeployment(DeploymentTarget deploymentTarget, DeployedArtifact artifact)
deploymentTarget - targetartifact - artifact@CheckForNull public static BehavioredClassifier getContext(Behavior behavior)
behavior - behavior for which to get the context.public static boolean canAssignType(TypedElement typedElement, @CheckForNull Type type)
typedElement - typed elementtype - type@CheckForNull public static ConnectorEnd getFirstEnd(Connector connector)
connector - connector@CheckForNull public static ConnectorEnd getSecondEnd(Connector connector)
connector - connector@CheckForNull public static ConnectorEnd getOppositeEnd(ConnectorEnd end)
end - connector end for which to get opposite end