|
|
|
|
|
Re: Custom validation for ID attribute [message #1387088 is a reply to message #1387075] |
Tue, 24 June 2014 04:58 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Agustin,
The pattern annotation is quite useful. Thanks for sharing your results.
On 24/06/2014 12:58 AM, Agustin Vosou wrote:
> After testing the ID EDataType from XMLType.ecore and it's
> constraints, I decided to go for the first option Ed gave me... So
> I've defined the following EDataType:
>
>
> <eClassifiers xsi:type="ecore:EDataType" name="ID"
> instanceClassName="java.lang.String">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="ID"/>
> <details key="baseType" value="java.lang.String"/>
> <details key="pattern" value="[a-zA-Z0-9]+"/>
> </eAnnotations>
> </eClassifiers>
>
>
> As you can see, I've used an ExtendedMetadata annotation to define the
> accepted values with a pattern.
>
> Thank you very much for your help and time.
>
> Regards,
> Agustin.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03018 seconds