|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faktorips.runtime.modeltype.internal.AbstractModelElement
org.faktorips.runtime.modeltype.internal.ModelTypeAssociation
public class ModelTypeAssociation
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.faktorips.runtime.modeltype.IModelTypeAssociation |
|---|
IModelTypeAssociation.AssociationType |
| Field Summary |
|---|
| 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 |
| Constructor Summary | |
|---|---|
ModelTypeAssociation(ModelType modelType)
|
|
| 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. |
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()
|
| Methods inherited from class org.faktorips.runtime.modeltype.internal.AbstractModelElement |
|---|
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initDescriptionsFromXml, initExtPropertiesFromXml, initLabelsFromXml, setExtensionPropertyValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.faktorips.runtime.modeltype.IModelElement |
|---|
getDescription, getExtensionPropertyIds, getExtensionPropertyValue, getLabel, getName, getRepository, initExtPropertiesFromXml |
| Constructor Detail |
|---|
public ModelTypeAssociation(ModelType modelType)
| Method Detail |
|---|
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()
IModelTypeAssociation
getModelType in interface IModelTypeAssociationpublic IModelTypeAssociation.AssociationType getAssociationType()
IModelTypeAssociation
getAssociationType 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 IModelTypeAssociation
public IModelType getTarget()
throws ClassNotFoundException
IModelTypeAssociation
getTarget in interface IModelTypeAssociationClassNotFoundException - if the target class could not be loaded.public List<IModelObject> getTargetObjects(IModelObject source)
IModelTypeAssociation
getTargetObjects in interface IModelTypeAssociationsource - a model object corresponding to the IModelType this association belongs
to
public boolean isProductRelevant()
IModelTypeAssociation
isProductRelevant in interface IModelTypeAssociation
public void initFromXml(XMLStreamReader parser)
throws XMLStreamException
IModelElement
initFromXml in interface IModelElementinitFromXml in class AbstractModelElementXMLStreamExceptionprotected void initLabelFromXml(XMLStreamReader parser)
initLabelFromXml in class AbstractModelElementpublic String toString()
toString in class Objectpublic String getUsedName()
IModelTypeAssociation
getUsedName in interface IModelTypeAssociationpublic boolean isDerivedUnion()
IModelTypeAssociation
isDerivedUnion in interface IModelTypeAssociationpublic boolean isSubsetOfADerivedUnion()
IModelTypeAssociation
isSubsetOfADerivedUnion in interface IModelTypeAssociationpublic String getInverseAssociation()
IModelTypeAssociation
getInverseAssociation 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 IModelTypeAssociation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||