Class Association
- Direct Known Subclasses:
PolicyAssociation,ProductAssociation
Types.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AssociationcreateOverwritingAssociationFor(Type subType) Optional<? extends Association>Returns the matching product respectively policy component type association or anempty Optionalif no matching association is defined for this association.Returns the association that is overridden by this association if this association overrides another one.protected IpsAssociationReturns what kind of association this is.protected StringgetDocumentation(Locale locale, DocumentationKind type, String fallback) protected MethodReturns the name of the inverse association if it is defined.getLabelForPlural(Locale locale) Returns the plural label for this model element in the specified locale.Returns the matching product respectively policy component type association ornullif no matching association is defined for this association.Returns the name of the matching product respectively policy component type association ornullif no matching association is defined for this association.Returns the qualified name of source type of the matching association ornullif no matching association is defined.Returns theTypeidentified bygetMatchingAssociationSource()intReturns the maximum cardinality for this association.intReturns the minimum cardinality for this association.Returns the plural form of this model type's name or the empty String if no plural for the name is set.protected StringReturns the association that is overridden by this association if this association overrides another one.Returns the targetTypeof this association.Returns the singular or plural form of this association's name as used in code generation depending on cardinality.booleanReturns if this association is a derived union.booleanReturnstrueif the association has a matching association.booleanReturnstrueif this association overrides another association.booleanReturns if this association is a subset of a derived union.protected booleanDetermines whether this association is a ..1 ("to one") association.toString()protected <V,R> void validate(MessageList list, Supplier<V> valueGetter, Supplier<R> referenceValueGetter, BiPredicate<V, R> valueChecker, BiFunction<V, R, String> messageTextGetter, String msgCode, ObjectProperty... invalidObjectProperties) protected <V,R> void validate(MessageList list, IValidationContext context, Supplier<V> valueGetter, Supplier<R> referenceValueGetter, BiPredicate<V, R> valueChecker, String msgCode, String msgKey, String property, ObjectProperty invalidObjectProperty) Methods inherited from class org.faktorips.runtime.model.type.TypePart
getMessageHelper, getMessageKey, getModelType, getType, getTypeName, isChangingOverTime, validateMethods inherited from class org.faktorips.runtime.model.type.ModelElement
createMessageHelper, getDeprecation, getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRelevantProductObject, getRelevantProductObject, invokeField, invokeMethod, isDeprecated
-
Field Details
-
PROPERTY_MAX_CARDINALITY
- See Also:
-
PROPERTY_MIN_CARDINALITY
- See Also:
-
-
Constructor Details
-
Association
-
-
Method Details
-
getLabelForPlural
Returns the plural label for this model element in the specified locale. If there is no plural label in the specified locale, it tries to find the plural label in the default locale. If there is also no plural label in the default locale the element's plural name is returned.- Returns:
- the label for the given locale or the element's name if no label exists for the given locale nor in the default locale
-
getAssociationKind
Returns what kind of association this is. -
getMinCardinality
public int getMinCardinality()Returns the minimum cardinality for this association.0if no minimum is set. -
getMaxCardinality
public int getMaxCardinality()Returns the maximum cardinality for this association.Integer.MAX_VALUEif no maximum is set. -
getNamePlural
Returns the plural form of this model type's name or the empty String if no plural for the name is set. -
getTarget
Returns the targetTypeof this association. -
getUsedName
Returns the singular or plural form of this association's name as used in code generation depending on cardinality. -
isDerivedUnion
public boolean isDerivedUnion()Returns if this association is a derived union. -
isSubsetOfADerivedUnion
public boolean isSubsetOfADerivedUnion()Returns if this association is a subset of a derived union. -
getInverseAssociation
Returns the name of the inverse association if it is defined.- Returns:
- The name of the inverse association or
nullif there is no inverse association or it is a product component associations
-
isMatchingAssociationPresent
public boolean isMatchingAssociationPresent()Returnstrueif the association has a matching association. For policy associations that means it is configured by the product component. For product component associations that means it configures a policy association.- Returns:
trueif this association has a matching association.- See Also:
-
getMatchingAssociationName
Returns the name of the matching product respectively policy component type association ornullif no matching association is defined for this association.Example: Taking two policy component types called 'Policy' and 'Coverage' with a composition association between them. Policy is constrained by the product component type 'Product' and coverage by 'CoverageType'. There is also an association from 'Product' to 'CoverageType'. The product association configures the policy association. If this is a model type association for the policy association this method returns the name of the matching product association and vice versa.
- Returns:
- The name of the matching association
-
getMatchingAssociation
Returns the matching product respectively policy component type association ornullif no matching association is defined for this association.Example: Taking two policy component types called 'Policy' and 'Coverage' with a composition association between them. Policy is constrained by the product component type 'Product' and coverage by 'CoverageType'. There is also an association from 'Product' to 'CoverageType'. The product association configures the policy association. If this is a association for the policy association this method returns the matching product association and vice versa.
- Returns:
- The matching association
-
findMatchingAssociation
Returns the matching product respectively policy component type association or anempty Optionalif no matching association is defined for this association.Example: Taking two policy component types called 'Policy' and 'Coverage' with a composition association between them. Policy is constrained by the product component type 'Product' and coverage by 'CoverageType'. There is also an association from 'Product' to 'CoverageType'. The product association configures the policy association. If this is a association for the policy association this method returns the matching product association and vice versa.
- Returns:
- The matching association
-
getMatchingAssociationSource
Returns the qualified name of source type of the matching association ornullif no matching association is defined.Example: Taking two policy component types called 'Policy' and 'Coverage' with a composition association between them. Policy is constrained by the product component type 'Product' and coverage by 'CoverageType'. There is also an association from 'Product' to 'CoverageType'. The product association configures the policy association. If this is a model type association for the policy association this method returns the qualified name of the source of the matching product association and vice versa. The source is the type which defines the matching association.
- Returns:
- The qualified name of the matching association source
-
getMatchingAssociationSourceType
Returns theTypeidentified bygetMatchingAssociationSource()- Returns:
- The
Typeof the matching association source - See Also:
-
isOverriding
public boolean isOverriding()Returnstrueif this association overrides another association. That means a supertype declares an association with the same name.- Returns:
trueif this association overrides another,falseif not- See Also:
-
getSuperAssociation
Returns the association that is overridden by this association if this association overrides another one. Otherwise returnsnull.- Returns:
- The association that is overridden by this attribute.
- See Also:
-
findSuperAssociation
Returns the association that is overridden by this association if this association overrides another one. Otherwise returns anempty Optional.- Returns:
- The association that is overridden by this attribute.
- See Also:
-
getGetterMethod
-
validate
protected <V,R> void validate(MessageList list, IValidationContext context, Supplier<V> valueGetter, Supplier<R> referenceValueGetter, BiPredicate<V, R> valueChecker, String msgCode, String msgKey, String property, ObjectProperty invalidObjectProperty) -
validate
protected <V,R> void validate(MessageList list, Supplier<V> valueGetter, Supplier<R> referenceValueGetter, BiPredicate<V, R> valueChecker, BiFunction<V, R, String> messageTextGetter, String msgCode, ObjectProperty... invalidObjectProperties) -
createOverwritingAssociationFor
-
toString
- Overrides:
toStringin classModelElement
-
isToOneAssociation
protected boolean isToOneAssociation()Determines whether this association is a ..1 ("to one") association.- Returns:
trueif this is a ..1 association,falseelse.
-
getAnnotation
-
getDocumentation
- Overrides:
getDocumentationin classModelElement
-
getResourceBundleName
-