[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.newcomer] Re: Setting the range of an ecore datatype
|
Hi Barath,
You specify the range through annotations. For example, if you wanted to
create a new data type that restricted strings to 255 characters you could
add this to your ecore model:
<eClassifiers xsi:type="ecore:EDataType" name="String255"
instanceClassName="java.lang.String">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="String255"/>
<details key="baseType"
value="http://www.eclipse.org/emf/2003/XMLType#string"/>
<details key="maxLength" value="255"/>
</eAnnotations>
</eClassifiers>
If you have an xsd editor you could create your definitions in the xsd and
then get EMF to turn the xsd into an ecore model.
Regards,
Jose
"Barath Kumar" <barath.kumar@xxxxxxxxx> wrote in message
news:028c997c4e2bcb832ee45957d17b0aaa$1@xxxxxxxxxxxxxxxxxx
> Hi..
>
> But unfornately I am not able to specify the range of the datatype when I
> am creating the ecore model using Ecore diagram.. \
>
>
> - Barath
>