public abstract class ModelElement extends Object implements IModelElement
IpsModel. Defines
basic properties shared by all such elements such as name,
label, description and
extension properties.| Constructor and Description |
|---|
ModelElement(String name,
IpsExtensionProperties extensionProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected MessagesHelper |
createMessageHelper(IpsDocumented documentedAnnotation,
ClassLoader classLoader) |
String |
getDescription(Locale locale)
Returns the description for this model element in the specified locale.
|
protected String |
getDocumentation(Locale locale,
DocumentationKind type,
String fallback) |
Set<String> |
getExtensionPropertyIds() |
Object |
getExtensionPropertyValue(String propertyId)
Returns the value for the given extension property identified by the specified id.
|
String |
getLabel(Locale locale)
Returns the label for this model element in the specified locale.
|
protected abstract MessagesHelper |
getMessageHelper() |
protected abstract String |
getMessageKey(DocumentationKind messageType) |
String |
getName() |
protected static Object |
getRelevantProductObject(IProductComponent productComponent,
Calendar effectiveDate,
boolean changingOverTime)
If the
changingOverTime is false, the given product component is
returned. |
protected Object |
invokeField(Field field,
Object source) |
protected Object |
invokeMethod(Method method,
Object source,
Object... arguments) |
String |
toString() |
public ModelElement(String name, IpsExtensionProperties extensionProperties)
public String getName()
getName in interface IModelElementpublic String getLabel(Locale locale)
getLabel in interface IModelElementpublic String getDescription(Locale locale)
getDescription in interface IModelElementprotected abstract String getMessageKey(DocumentationKind messageType)
protected String getDocumentation(Locale locale, DocumentationKind type, String fallback)
protected abstract MessagesHelper getMessageHelper()
protected MessagesHelper createMessageHelper(IpsDocumented documentedAnnotation, ClassLoader classLoader)
public Object getExtensionPropertyValue(String propertyId)
Note: At the moment only String is supported as extension property value. This method
returns Object for future changes.
getExtensionPropertyValue in interface IModelElementpropertyId or
null if the extension property's isNull attribute is
trueIllegalArgumentException - if no such property existspublic Set<String> getExtensionPropertyIds()
getExtensionPropertyIds in interface IModelElementprotected static Object getRelevantProductObject(IProductComponent productComponent, Calendar effectiveDate, boolean changingOverTime)
changingOverTime is false, the given product component is
returned. If changing over time is true, the effective date is used to determine
the generation to use. If the effective date is null, the latest product
component generation is returned.productComponent - the product component to potentially retrieve a generation fromeffectiveDate - the date to select the product component generation. If
null the latest generation is used. Is ignored if the model element's
configuration is not changing over time.changingOverTime - whether the model element is changing over time.Copyright © 2019. All rights reserved.