Generic Parse Operations

The generic parse operation, performed by the DomainConverter interface's parseGeneric method, needs some explanation, so that care can be taken not to disable its operation by mistake. The generic parse operation is responsible for parsing the string representation of values defined in the UML model's domain definition options. Domain options for maximum, minimum and default values are expressed in formats that are not locale-specific, as the UML model is not locale-aware. Each of the root domains accepts values in a particular format (e.g., ISO-8601 format for SVR_DATE domains) and customization of this format is not supported. Therefore, the default implementations of the parseGeneric method must be respected.

For some domains, the format supported by the converter's parse method is the same as the format supported by the parseGeneric method. The default implementation of the parseGeneric method in the AbstractConverter class just calls the parse method (which is not implemented in this class). Therefore, if you sub-class the AbstractConverter class and implement a parse method, the same implementation will be used by the parseGeneric method. This may be what you require, but, if it is not, you may want to implement a different parseGeneric method.

All of the out-of-the-box, concrete converter classes separate the implementations of the two methods, so you can override one without changing the behavior of the other. Again, this may be what you require, but, if it is not, you may want to override both methods.