Class Association

    • Constructor Detail

      • Association

        public Association​(Type type,
                           java.lang.reflect.Method getterMethod)
    • Method Detail

      • getLabelForPlural

        public java.lang.String getLabelForPlural​(java.util.Locale locale)
        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

        public AssociationKind getAssociationKind()
        Returns what kind of association this is.
      • getMinCardinality

        public int getMinCardinality()
        Returns the minimum cardinality for this association. 0 if no minimum is set.
      • getMaxCardinality

        public int getMaxCardinality()
        Returns the maximum cardinality for this association. Integer.MAX_VALUE if no maximum is set.
      • getNamePlural

        public java.lang.String getNamePlural()
        Returns the plural form of this model type's name or the empty String if no plural for the name is set.
      • getTarget

        public Type getTarget()
        Returns the target Type of this association.
      • getUsedName

        public java.lang.String 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

        public java.lang.String getInverseAssociation()
        Returns the name of the inverse association if it is defined.
        Returns:
        The name of the inverse association or null if there is no inverse association or it is a product component associations
      • isMatchingAssociationPresent

        public boolean isMatchingAssociationPresent()
        Returns true if 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:
        true if this association has a matching association.
        See Also:
        getMatchingAssociationName()
      • getMatchingAssociationName

        public java.lang.String getMatchingAssociationName()
        Returns the name of the matching product respectively policy component type association or null if 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

        public Association getMatchingAssociation()
        Returns the matching product respectively policy component type association or null if 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

        public java.util.Optional<? extends Association> findMatchingAssociation()
        Returns the matching product respectively policy component type association or an empty Optional if 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

        public java.lang.String getMatchingAssociationSource()
        Returns the qualified name of source type of the matching association or null if 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
      • isOverriding

        public boolean isOverriding()
        Returns true if this association overrides another association. That means a supertype declares an association with the same name.
        Returns:
        true if this association overrides another, false if not
        See Also:
        getSuperAssociation()
      • getSuperAssociation

        public Association getSuperAssociation()
        Returns the association that is overridden by this association if this association overrides another one. Otherwise returns null.
        Returns:
        The association that is overridden by this attribute.
        See Also:
        isOverriding()
      • findSuperAssociation

        public java.util.Optional<Association> findSuperAssociation()
        Returns the association that is overridden by this association if this association overrides another one. Otherwise returns an empty Optional.
        Returns:
        The association that is overridden by this attribute.
        See Also:
        isOverriding()
      • getGetterMethod

        protected java.lang.reflect.Method getGetterMethod()
      • createOverwritingAssociationFor

        public abstract Association createOverwritingAssociationFor​(Type subType)
      • isToOneAssociation

        protected boolean isToOneAssociation()
        Determines whether this association is a ..1 ("to one") association.
        Returns:
        true if this is a ..1 association, false else.