public class ModelTypeAssociation extends AbstractModelElement implements IModelTypeAssociation
IModelTypeAssociation.AssociationTypePROPERTY_ASSOCIATION_TYPE, PROPERTY_DERIVED_UNION, PROPERTY_INVERSE_ASSOCIATION, PROPERTY_MATCHING_ASSOCIATION_NAME, PROPERTY_MATCHING_ASSOCIATION_SOURCE, PROPERTY_MAX_CARDINALITY, PROPERTY_MIN_CARDINALITY, PROPERTY_NAME_PLURAL, PROPERTY_PRODUCT_RELEVANT, PROPERTY_SUBSET_OF_A_DERIVED_UNION, PROPERTY_TARGET, PROPERTY_TARGET_ROLE_PLURAL_REQUIRED, XML_TAG, XML_WRAPPER_TAGDESCRIPTIONS_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| Constructor and Description |
|---|
ModelTypeAssociation(ModelType modelType) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
initFromXml(XMLStreamReader parser)
Initializes the model element's state with the data stored in the xml element at the parser's
current position.
|
protected void |
initLabelFromXml(XMLStreamReader parser) |
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.
|
String |
toString() |
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initDescriptionsFromXml, initExtPropertiesFromXml, initLabelsFromXml, setExtensionPropertyValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initExtPropertiesFromXmlpublic ModelTypeAssociation(ModelType modelType)
public String getLabelForPlural(Locale locale)
IModelTypeAssociationReturns the association's plural name if no plural label for the given locale exists.
getLabelForPlural in interface IModelTypeAssociationpublic IModelType getModelType()
IModelTypeAssociationgetModelType in interface IModelTypeAssociationpublic IModelTypeAssociation.AssociationType getAssociationType()
IModelTypeAssociationgetAssociationType in interface IModelTypeAssociationpublic int getMaxCardinality()
IModelTypeAssociationInteger.MAX_VALUE if no
maximum is set.getMaxCardinality in interface IModelTypeAssociationpublic int getMinCardinality()
IModelTypeAssociation0 if no minimum is set.getMinCardinality in interface IModelTypeAssociationpublic String getNamePlural()
IModelTypeAssociationnull if no plural for for
the name is set.getNamePlural in interface IModelTypeAssociationpublic IModelType getTarget() throws ClassNotFoundException
IModelTypeAssociationgetTarget in interface IModelTypeAssociationClassNotFoundException - if the target class could not be loaded.public List<IModelObject> getTargetObjects(IModelObject source)
IModelTypeAssociationgetTargetObjects in interface IModelTypeAssociationsource - a model object corresponding to the IModelType this association belongs
topublic boolean isProductRelevant()
IModelTypeAssociationisProductRelevant in interface IModelTypeAssociationpublic void initFromXml(XMLStreamReader parser) throws XMLStreamException
IModelElementinitFromXml in interface IModelElementinitFromXml in class AbstractModelElementXMLStreamExceptionprotected void initLabelFromXml(XMLStreamReader parser)
initLabelFromXml in class AbstractModelElementpublic String getUsedName()
IModelTypeAssociationgetUsedName in interface IModelTypeAssociationpublic boolean isDerivedUnion()
IModelTypeAssociationisDerivedUnion in interface IModelTypeAssociationpublic boolean isSubsetOfADerivedUnion()
IModelTypeAssociationisSubsetOfADerivedUnion in interface IModelTypeAssociationpublic String getInverseAssociation()
IModelTypeAssociationgetInverseAssociation in interface IModelTypeAssociationpublic String getMatchingAssociationName()
IModelTypeAssociationnull 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.
getMatchingAssociationName in interface IModelTypeAssociationpublic String getMatchingAssociationSource()
IModelTypeAssociationnull 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.
getMatchingAssociationSource in interface IModelTypeAssociationCopyright © 2014. All rights reserved.