org.faktorips.runtime.modeltype
Interface IModelTypeAssociation

All Superinterfaces:
IModelElement
All Known Implementing Classes:
ModelTypeAssociation

public interface IModelTypeAssociation
extends IModelElement

Author:
Daniel Hohenberger

Nested Class Summary
static class IModelTypeAssociation.AssociationType
          Enum defining the possible association types.
 
Field Summary
static String PROPERTY_ASSOCIATION_TYPE
           
static String PROPERTY_DERIVED_UNION
           
static String PROPERTY_INVERSE_ASSOCIATION
           
static String PROPERTY_MATCHING_ASSOCIATION_NAME
           
static String PROPERTY_MATCHING_ASSOCIATION_SOURCE
           
static String PROPERTY_MAX_CARDINALITY
           
static String PROPERTY_MIN_CARDINALITY
           
static String PROPERTY_NAME_PLURAL
           
static String PROPERTY_PRODUCT_RELEVANT
           
static String PROPERTY_SUBSET_OF_A_DERIVED_UNION
           
static String PROPERTY_TARGET
           
static String PROPERTY_TARGET_ROLE_PLURAL_REQUIRED
           
static String XML_TAG
           
static String XML_WRAPPER_TAG
           
 
Fields inherited from interface org.faktorips.runtime.modeltype.IModelElement
DESCRIPTIONS_PROPERTY_LOCALE, DESCRIPTIONS_XML_TAG, DESCRIPTIONS_XML_WRAPPER_TAG, EXTENSION_PROPERTIES_PROPERTY_ID, EXTENSION_PROPERTIES_PROPERTY_NULL, EXTENSION_PROPERTIES_XML_TAG, EXTENSION_PROPERTIES_XML_WRAPPER_TAG, LABELS_PROPERTY_LOCALE, LABELS_PROPERTY_PLURAL_VALUE, LABELS_PROPERTY_VALUE, LABELS_XML_TAG, LABELS_XML_WRAPPER_TAG, PROPERTY_NAME
 
Method Summary
 IModelTypeAssociation.AssociationType getAssociationType()
          Returns the type of this association.
 String getInverseAssociation()
          Returns the name of the inverse association if it is defined.
 String getLabelForPlural(Locale locale)
          Returns the plural label for the given locale.
 String getMatchingAssociationName()
          Returns the name of the matching product respectively policy component type association or null if no matching association is defined for this associations.
 String getMatchingAssociationSource()
          Returns the qualified target name of the matching product respectively policy component type association or null if no matching association is defined for component associations.
 int getMaxCardinality()
          Returns the maximum cardinality for this association.
 int getMinCardinality()
          Returns the minimum cardinality for this association.
 IModelType getModelType()
          Returns the model type this association belongs to.
 String getNamePlural()
          Returns the plural form of this model type's name or null if no plural for for the name is set.
 IModelType getTarget()
          Returns the target model type object of this association.
 List<IModelObject> getTargetObjects(IModelObject source)
          Returns a list of the target(s) of the given model object's association identified by this model type association.
 String getUsedName()
          Returns the singular or plural form of this model type's name as used in code generation depending on cardinality.
 boolean isDerivedUnion()
          Returns if this association is a derived union.
 boolean isProductRelevant()
          Returns if this association is product relevant.
 boolean isSubsetOfADerivedUnion()
          Returns if this association is a subset of a derived union.
 
Methods inherited from interface org.faktorips.runtime.modeltype.IModelElement
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initExtPropertiesFromXml, initFromXml
 

Field Detail

XML_TAG

static final String XML_TAG
See Also:
Constant Field Values

XML_WRAPPER_TAG

static final String XML_WRAPPER_TAG
See Also:
Constant Field Values

PROPERTY_NAME_PLURAL

static final String PROPERTY_NAME_PLURAL
See Also:
Constant Field Values

PROPERTY_TARGET

static final String PROPERTY_TARGET
See Also:
Constant Field Values

PROPERTY_MIN_CARDINALITY

static final String PROPERTY_MIN_CARDINALITY
See Also:
Constant Field Values

PROPERTY_MAX_CARDINALITY

static final String PROPERTY_MAX_CARDINALITY
See Also:
Constant Field Values

PROPERTY_ASSOCIATION_TYPE

static final String PROPERTY_ASSOCIATION_TYPE
See Also:
Constant Field Values

PROPERTY_PRODUCT_RELEVANT

static final String PROPERTY_PRODUCT_RELEVANT
See Also:
Constant Field Values

PROPERTY_DERIVED_UNION

static final String PROPERTY_DERIVED_UNION
See Also:
Constant Field Values

PROPERTY_SUBSET_OF_A_DERIVED_UNION

static final String PROPERTY_SUBSET_OF_A_DERIVED_UNION
See Also:
Constant Field Values

PROPERTY_TARGET_ROLE_PLURAL_REQUIRED

static final String PROPERTY_TARGET_ROLE_PLURAL_REQUIRED
See Also:
Constant Field Values

PROPERTY_INVERSE_ASSOCIATION

static final String PROPERTY_INVERSE_ASSOCIATION
See Also:
Constant Field Values

PROPERTY_MATCHING_ASSOCIATION_NAME

static final String PROPERTY_MATCHING_ASSOCIATION_NAME
See Also:
Constant Field Values

PROPERTY_MATCHING_ASSOCIATION_SOURCE

static final String PROPERTY_MATCHING_ASSOCIATION_SOURCE
See Also:
Constant Field Values
Method Detail

getModelType

IModelType getModelType()
Returns the model type this association belongs to.


getTarget

IModelType getTarget()
                     throws ClassNotFoundException
Returns the target model type object of this association.

Throws:
ClassNotFoundException - if the target class could not be loaded.

getMinCardinality

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


getMaxCardinality

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


getNamePlural

String getNamePlural()
Returns the plural form of this model type's name or null if no plural for for the name is set.


getUsedName

String getUsedName()
Returns the singular or plural form of this model type's name as used in code generation depending on cardinality.


getAssociationType

IModelTypeAssociation.AssociationType getAssociationType()
Returns the type of this association.


isProductRelevant

boolean isProductRelevant()
Returns if this association is product relevant.


isDerivedUnion

boolean isDerivedUnion()
Returns if this association is a derived union.


isSubsetOfADerivedUnion

boolean isSubsetOfADerivedUnion()
Returns if this association is a subset of a derived union.


getInverseAssociation

String getInverseAssociation()
Returns the name of the inverse association if it is defined.

Returns:
The name of the inverse association or null for product component associations

getLabelForPlural

String getLabelForPlural(Locale locale)
Returns the plural label for the given locale.

Returns the association's plural name if no plural label for the given locale exists.


getTargetObjects

List<IModelObject> getTargetObjects(IModelObject source)
Returns a list of the target(s) of the given model object's association identified by this model type association.

Parameters:
source - a model object corresponding to the IModelType this association belongs to
Returns:
a list of the target(s) of the given model object's association identified by this model type association
Throws:
IllegalArgumentException - if the model object does not have an association fitting this model type association or that association is not accessible for any reason

getMatchingAssociationName

String getMatchingAssociationName()
Returns the name of the matching product respectively policy component type association or null if no matching association is defined for this associations.

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 matchingAssoctiation

getMatchingAssociationSource

String getMatchingAssociationSource()
Returns the qualified target name of the matching product respectively policy component type association or null if no matching association is defined for component associations.

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 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 matchingAssoctiation


Copyright © 2015. All rights reserved.