Package org.faktorips.runtime
Interface IModelObject
- All Known Subinterfaces:
IConfigurableModelObject,ITimedConfigurableModelObject
- All Known Implementing Classes:
AbstractJaxbModelObject,AbstractModelObject
public interface IModelObject
Base interface for all model objects.
- Author:
- Jan Ortmann
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanConstant for the return values of validate methods (i.e.static final booleanConstant for the return values of validate methods (i.e. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetDescription(Locale locale) Returns a description for this model object in the specified locale.validate(IValidationContext context) Validates the model object and returns a list of messages.
-
Field Details
-
STOP_VALIDATION
static final boolean STOP_VALIDATIONConstant for the return values of validate methods (i.e. validateSelf() or ruleXYZ()). Indicates that the validation should be stopped.- See Also:
-
CONTINUE_VALIDATION
static final boolean CONTINUE_VALIDATIONConstant for the return values of validate methods (i.e. validateSelf() or ruleXYZ()). Indicates that the validation should be continued.- See Also:
-
-
Method Details
-
validate
Validates the model object and returns a list of messages. If no message is generated the method returns an empty list. Note that also messages like warnings or informations can be returned for valid objects.- Parameters:
context- provides additional external information that might be necessary to execute the validation. E.g. the business context, the locale to provide locale specific message texts, user information. The parameter must not benull.- Throws:
NullPointerException- if context isnull.
-
getDescription
Returns a description for this model object in the specified locale. The description can be used for possible error messages.- Parameters:
locale- the locale/language in which the description should be given- Returns:
- the description for the given locale/language or the result of the
toStringmethod if no custom implementation is provided
-