Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Declare an array type
Declare an array type [message #476673] Tue, 27 November 2007 20:25 Go to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi,
I have add in Uml Metamodel (written through graphical interface
'Sample Ecore Model Editor') a metaclass where EAttribute is an Array
data type. Is it possible? How can I do?

Thanks
Luciana
Re: Declare an array type [message #476674 is a reply to message #476673] Tue, 27 November 2007 20:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Luciana,

In Ecore itself you'd just define an EDataType whose instance class in
an array. E.g., the instance type of EByteArray is "byte[]". You
might define MyStringArray to have type "java.lang.String[]". I'm not
sure how to do that in UML...


Luciana wrote:
> Hi,
> I have add in Uml Metamodel (written through graphical interface
> 'Sample Ecore Model Editor') a metaclass where EAttribute is an Array
> data type. Is it possible? How can I do?
>
> Thanks
> Luciana
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Declare an array type [message #476675 is a reply to message #476674] Tue, 27 November 2007 21:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi Ed,
in the metamodel I have only type <java.lan.string> and not
<java.lang.string[]>. Can I import the latter in any way?

thank you
Luciana
Re: Declare an array type [message #476676 is a reply to message #476675] Tue, 27 November 2007 22:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Luciana,

I'm not even sure if you're talking about Ecore or UML. In either case,
I think you need to define your own EDataType or whatever it is in UML
because I don't think it will just exist for you already.


Luciana wrote:
> Hi Ed,
> in the metamodel I have only type <java.lan.string> and not
> <java.lang.string[]>. Can I import the latter in any way?
>
> thank you
> Luciana
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Declare an array type [message #476677 is a reply to message #476676] Tue, 27 November 2007 22:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi,
I'm talking about Ecore.
I have try to declare a metaclass with an EReference with
molteplicity 0..* of type MyArray, but when I istance the model
I can't insert the value.
Now, I try to repeat everything.
Thank you very much.
Luciana
Re: Declare an array type [message #476681 is a reply to message #476677] Wed, 28 November 2007 13:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040508080200050305080605
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Luciana,

An EReference's eType must be an EClass so it sounds to me like you need
an EAttribute. Note also that by default, the EDataType you define
based on an array type will serialize using java.io.Serializeable which
is not human readable, so likely you will want to specialize the
createMyArrayFromString and converterMyArrayToString methods to use a
human readable result. Note that it's best to ask about Ecore on the
EMF newsgroup.

news://news.eclipse.org/eclipse.tools.emf


Luciana wrote:
> Hi,
> I'm talking about Ecore.
> I have try to declare a metaclass with an EReference with
> molteplicity 0..* of type MyArray, but when I istance the model I
> can't insert the value.
> Now, I try to repeat everything.
> Thank you very much.
> Luciana
>


--------------040508080200050305080605
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Luciana,<br>
<br>
An EReference's eType must be an EClass so it sounds to me like you
need an EAttribute.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Declare an array type [message #476685 is a reply to message #476681] Wed, 28 November 2007 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Thank you very much,
I will also ask about Ecore in EMF newsgroup.
Luciana
Re: Declare an array type [message #625574 is a reply to message #476673] Tue, 27 November 2007 20:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Luciana,

In Ecore itself you'd just define an EDataType whose instance class in
an array. E.g., the instance type of EByteArray is "byte[]". You
might define MyStringArray to have type "java.lang.String[]". I'm not
sure how to do that in UML...


Luciana wrote:
> Hi,
> I have add in Uml Metamodel (written through graphical interface
> 'Sample Ecore Model Editor') a metaclass where EAttribute is an Array
> data type. Is it possible? How can I do?
>
> Thanks
> Luciana
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Declare an array type [message #625575 is a reply to message #476674] Tue, 27 November 2007 21:33 Go to previous message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi Ed,
in the metamodel I have only type <java.lan.string> and not
<java.lang.string[]>. Can I import the latter in any way?

thank you
Luciana
Re: Declare an array type [message #625576 is a reply to message #476675] Tue, 27 November 2007 22:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Luciana,

I'm not even sure if you're talking about Ecore or UML. In either case,
I think you need to define your own EDataType or whatever it is in UML
because I don't think it will just exist for you already.


Luciana wrote:
> Hi Ed,
> in the metamodel I have only type <java.lan.string> and not
> <java.lang.string[]>. Can I import the latter in any way?
>
> thank you
> Luciana
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Declare an array type [message #625577 is a reply to message #476676] Tue, 27 November 2007 22:57 Go to previous message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hi,
I'm talking about Ecore.
I have try to declare a metaclass with an EReference with
molteplicity 0..* of type MyArray, but when I istance the model
I can't insert the value.
Now, I try to repeat everything.
Thank you very much.
Luciana
Re: Declare an array type [message #625652 is a reply to message #476677] Wed, 28 November 2007 13:21 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040508080200050305080605
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Luciana,

An EReference's eType must be an EClass so it sounds to me like you need
an EAttribute. Note also that by default, the EDataType you define
based on an array type will serialize using java.io.Serializeable which
is not human readable, so likely you will want to specialize the
createMyArrayFromString and converterMyArrayToString methods to use a
human readable result. Note that it's best to ask about Ecore on the
EMF newsgroup.

news://news.eclipse.org/eclipse.tools.emf


Luciana wrote:
> Hi,
> I'm talking about Ecore.
> I have try to declare a metaclass with an EReference with
> molteplicity 0..* of type MyArray, but when I istance the model I
> can't insert the value.
> Now, I try to repeat everything.
> Thank you very much.
> Luciana
>


--------------040508080200050305080605
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Luciana,<br>
<br>
An EReference's eType must be an EClass so it sounds to me like you
need an EAttribute.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Declare an array type [message #625656 is a reply to message #476681] Wed, 28 November 2007 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Thank you very much,
I will also ask about Ecore in EMF newsgroup.
Luciana
Previous Topic:New version of Groovy EMFBuilder supports UML2 models
Next Topic:[Announce] MDT UML2 2.2.0 I200711291020 is available
Goto Forum:
  


Current Time: Thu Apr 25 22:50:21 GMT 2024

Powered by FUDForum. Page generated in 0.03667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top