Home » Modeling » OCL » RE: IProviderOperationExecutor execute method
|
RE: IProviderOperationExecutor execute method [message #59295 is a reply to message #59269] |
Thu, 17 July 2008 14:13 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
--=-ccFWNL/8FWgwBuoOszlP
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, Mark,
This is one of those examples of the caveat against implementing or
using internal API :-D
The 1.2 release of this component adopts J2SE 5.0, including the
genericity capability. The return type T is a type parameter of the
IProviderOperation, constrained to be some kind of collection of some
kind of IModelConstraint type.
The IProviderOperation and IProviderOperationExecutor interfaces both
are internal API. Does our example demonstrate implementation/usage of
these internal APIs?
cW
On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:
> Hi,
>
> I had been messing around with the validation examples and with the help
> of Christian I was able to get an OCL to be validated against my EMF
> model. I got this working on a previous version on eclipse, and now trying
> to get it working on the new version. I notice some of the code has been
> updated, for example I am the class
> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
> the IProviderOperationExecutor execute action has changed and now gives a
> return type 'T', which was previously void. Does anybody have any idea of
> why this changed and what T is?
>
> public IValidator newValidator(EvaluationMode mode) {
> assert mode != null && !mode.isNull();
>
> IProviderOperationExecutor executor = new IProviderOperationExecutor() {
> public void execute(IProviderOperation op) { < --ERROR - VOID NOT
> COMPATIABLE
> MyModelValidationService.this.execute(op);
> }};
>
> if (mode == EvaluationMode.BATCH) {
> return new BatchValidator(executor);
> } else if (mode == EvaluationMode.LIVE) {
> return new LiveValidator(executor);
> } else {
> throw new IllegalArgumentException();
> }
> }
>
> I hope this makes sense - thanks for your help,
> Mark
>
--=-ccFWNL/8FWgwBuoOszlP
Content-Type: text/html; charset=utf-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Mark,<BR>
<BR>
This is one of those examples of the caveat against implementing or using internal API :-D<BR>
<BR>
The 1.2 release of this component adopts J2SE 5.0, including the genericity capability. The return type T is a type parameter of the IProviderOperation, constrained to be some kind of collection of some kind of IModelConstraint type.<BR>
<BR>
The IProviderOperation and IProviderOperationExecutor interfaces both are internal API. Does our example demonstrate implementation/usage of these internal APIs?<BR>
<BR>
cW<BR>
<BR>
<BR>
On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi,</FONT>
<FONT COLOR="#000000">I had been messing around with the validation examples and with the help </FONT>
<FONT COLOR="#000000">of Christian I was able to get an OCL to be validated against my EMF </FONT>
<FONT COLOR="#000000">model. I got this working on a previous version on eclipse, and now trying </FONT>
<FONT COLOR="#000000">to get it working on the new version. I notice some of the code has been </FONT>
<FONT COLOR="#000000">updated, for example I am the class </FONT>
<FONT COLOR="#000000"> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService, </FONT>
<FONT COLOR="#000000">the IProviderOperationExecutor execute action has changed and now gives a </FONT>
<FONT COLOR="#000000">return type 'T', which was previously void. Does anybody have any idea of </FONT>
<FONT COLOR="#000000">why this changed and what T is?</FONT>
<FONT COLOR="#000000">public IValidator newValidator(EvaluationMode mode) {</FONT>
<FONT COLOR="#000000"> assert mode != null && !mode.isNull();</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> IProviderOperationExecutor executor = new IProviderOperationExecutor() {</FONT>
<FONT COLOR="#000000"> public void execute(IProviderOperation op) { < --ERROR - VOID NOT </FONT>
<FONT COLOR="#000000">COMPATIABLE </FONT>
<FONT COLOR="#000000"> MyModelValidationService.this.execute(op);</FONT>
<FONT COLOR="#000000"> }};</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> if (mode == EvaluationMode.BATCH) {</FONT>
<FONT COLOR="#000000"> return new BatchValidator(executor);</FONT>
<FONT COLOR="#000000"> } else if (mode == EvaluationMode.LIVE) {</FONT>
<FONT COLOR="#000000"> return new LiveValidator(executor);</FONT>
<FONT COLOR="#000000"> } else {</FONT>
<FONT COLOR="#000000"> throw new IllegalArgumentException();</FONT>
<FONT COLOR="#000000"> }</FONT>
<FONT COLOR="#000000"> }</FONT>
<FONT COLOR="#000000">I hope this makes sense - thanks for your help,</FONT>
<FONT COLOR="#000000">Mark</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-ccFWNL/8FWgwBuoOszlP--
|
|
|
Re: IProviderOperationExecutor execute method [message #59318 is a reply to message #59295] |
Thu, 17 July 2008 14:35 |
Mark Melia Messages: 142 Registered: July 2009 |
Senior Member |
|
|
Hey Christian,
How are you, I annoyed you with this problem some time ago and you helped
me get it up and running - thanks for helping me again :)
The example does seem to be useing interfaces. Basically what we have done
is extend your example from org.eclipse.emf.validation.examples.general to
work in with our GMF project. Our GMF project has been updated, and so has
the Eclipse landscape so I was trying to get the OCL validation of models
to work again.
Perhaps there is a better way of doing this now? I was looking for a
update to this example, but the download manger has changed and I cant
find any OCL validation examples - is there any around?
Any help would be much appricated.
Mark
Christian W. Damus wrote:
> Hi, Mark,
> This is one of those examples of the caveat against implementing or
> using internal API :-D
> The 1.2 release of this component adopts J2SE 5.0, including the
> genericity capability. The return type T is a type parameter of the
> IProviderOperation, constrained to be some kind of collection of some
> kind of IModelConstraint type.
> The IProviderOperation and IProviderOperationExecutor interfaces both
> are internal API. Does our example demonstrate implementation/usage of
> these internal APIs?
> cW
> On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:
>> Hi,
>>
>> I had been messing around with the validation examples and with the help
>> of Christian I was able to get an OCL to be validated against my EMF
>> model. I got this working on a previous version on eclipse, and now trying
>> to get it working on the new version. I notice some of the code has been
>> updated, for example I am the class
>>
org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
>> the IProviderOperationExecutor execute action has changed and now gives a
>> return type 'T', which was previously void. Does anybody have any idea of
>> why this changed and what T is?
>>
>> public IValidator newValidator(EvaluationMode mode) {
>> assert mode != null && !mode.isNull();
>>
>> IProviderOperationExecutor executor = new IProviderOperationExecutor() {
>> public void execute(IProviderOperation op) { < --ERROR - VOID NOT
>> COMPATIABLE
>> MyModelValidationService.this.execute(op);
>> }};
>>
>> if (mode == EvaluationMode.BATCH) {
>> return new BatchValidator(executor);
>> } else if (mode == EvaluationMode.LIVE) {
>> return new LiveValidator(executor);
>> } else {
>> throw new IllegalArgumentException();
>> }
>> }
>>
>> I hope this makes sense - thanks for your help,
>> Mark
>>
|
|
|
Re: IProviderOperationExecutor execute method [message #59343 is a reply to message #59318] |
Fri, 18 July 2008 01:18 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
--=-ludr1XHsT4d3mHp2EpQZ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, Mark,
Annoyed? Nah. You're a regular contributor in the newsgroups, and
welcome.
Yes. An example that demonstrates how to violate the API rules would
seem like a bad idea, but I don't see an example that does this. It
would appear that you dreamt the whole thing. :-P I don't even see a
reason why you should want to implement your own validation service.
The OCL validation example should still be there ... if you installed
the EMF Validation Framework SDK, that is. Look for it in the "File ->
New -> Example..." menu, in the "EMF Validation Framework Plug-ins"
category. It has a new example demonstrating how to create a dynamic
constraint provider; the example loads OCL constraints from a *.ocl
document.
Cheers,
Christian
On Thu, 2008-07-17 at 14:35 +0000, Mark Melia wrote:
> Hey Christian,
>
> How are you, I annoyed you with this problem some time ago and you helped
> me get it up and running - thanks for helping me again :)
>
> The example does seem to be useing interfaces. Basically what we have done
> is extend your example from org.eclipse.emf.validation.examples.general to
> work in with our GMF project. Our GMF project has been updated, and so has
> the Eclipse landscape so I was trying to get the OCL validation of models
> to work again.
>
> Perhaps there is a better way of doing this now? I was looking for a
> update to this example, but the download manger has changed and I cant
> find any OCL validation examples - is there any around?
>
> Any help would be much appricated.
>
> Mark
>
>
> Christian W. Damus wrote:
>
> > Hi, Mark,
>
> > This is one of those examples of the caveat against implementing or
> > using internal API :-D
>
> > The 1.2 release of this component adopts J2SE 5.0, including the
> > genericity capability. The return type T is a type parameter of the
> > IProviderOperation, constrained to be some kind of collection of some
> > kind of IModelConstraint type.
>
> > The IProviderOperation and IProviderOperationExecutor interfaces both
> > are internal API. Does our example demonstrate implementation/usage of
> > these internal APIs?
>
> > cW
>
>
> > On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:
>
> >> Hi,
> >>
> >> I had been messing around with the validation examples and with the help
> >> of Christian I was able to get an OCL to be validated against my EMF
> >> model. I got this working on a previous version on eclipse, and now trying
> >> to get it working on the new version. I notice some of the code has been
> >> updated, for example I am the class
> >>
> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
> >> the IProviderOperationExecutor execute action has changed and now gives a
> >> return type 'T', which was previously void. Does anybody have any idea of
> >> why this changed and what T is?
> >>
> >> public IValidator newValidator(EvaluationMode mode) {
> >> assert mode != null && !mode.isNull();
> >>
> >> IProviderOperationExecutor executor = new IProviderOperationExecutor() {
> >> public void execute(IProviderOperation op) { < --ERROR - VOID NOT
> >> COMPATIABLE
> >> MyModelValidationService.this.execute(op);
> >> }};
> >>
> >> if (mode == EvaluationMode.BATCH) {
> >> return new BatchValidator(executor);
> >> } else if (mode == EvaluationMode.LIVE) {
> >> return new LiveValidator(executor);
> >> } else {
> >> throw new IllegalArgumentException();
> >> }
> >> }
> >>
> >> I hope this makes sense - thanks for your help,
> >> Mark
> >>
>
>
--=-ludr1XHsT4d3mHp2EpQZ
Content-Type: text/html; charset=utf-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Mark,<BR>
<BR>
Annoyed? Nah. You're a regular contributor in the newsgroups, and welcome.<BR>
<BR>
Yes. An example that demonstrates how to violate the API rules would seem like a bad idea, but I don't see an example that does this. It would appear that you dreamt the whole thing. :-P I don't even see a reason why you should want to implement your own validation service.<BR>
<BR>
The OCL validation example should still be there ... if you installed the EMF Validation Framework SDK, that is. Look for it in the "File -> New -> Example..." menu, in the "EMF Validation Framework Plug-ins" category. It has a new example demonstrating how to create a dynamic constraint provider; the example loads OCL constraints from a *.ocl document.<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2008-07-17 at 14:35 +0000, Mark Melia wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hey Christian,</FONT>
<FONT COLOR="#000000">How are you, I annoyed you with this problem some time ago and you helped </FONT>
<FONT COLOR="#000000">me get it up and running - thanks for helping me again :)</FONT>
<FONT COLOR="#000000">The example does seem to be useing interfaces. Basically what we have done </FONT>
<FONT COLOR="#000000">is extend your example from org.eclipse.emf.validation.examples.general to </FONT>
<FONT COLOR="#000000">work in with our GMF project. Our GMF project has been updated, and so has </FONT>
<FONT COLOR="#000000">the Eclipse landscape so I was trying to get the OCL validation of models </FONT>
<FONT COLOR="#000000">to work again.</FONT>
<FONT COLOR="#000000">Perhaps there is a better way of doing this now? I was looking for a </FONT>
<FONT COLOR="#000000">update to this example, but the download manger has changed and I cant </FONT>
<FONT COLOR="#000000">find any OCL validation examples - is there any around?</FONT>
<FONT COLOR="#000000">Any help would be much appricated.</FONT>
<FONT COLOR="#000000">Mark</FONT>
<FONT COLOR="#000000">Christian W. Damus wrote:</FONT>
<FONT COLOR="#000000">> Hi, Mark,</FONT>
<FONT COLOR="#000000">> This is one of those examples of the caveat against implementing or</FONT>
<FONT COLOR="#000000">> using internal API :-D</FONT>
<FONT COLOR="#000000">> The 1.2 release of this component adopts J2SE 5.0, including the</FONT>
<FONT COLOR="#000000">> genericity capability. The return type T is a type parameter of the</FONT>
<FONT COLOR="#000000">> IProviderOperation, constrained to be some kind of collection of some</FONT>
<FONT COLOR="#000000">> kind of IModelConstraint type.</FONT>
<FONT COLOR="#000000">> The IProviderOperation and IProviderOperationExecutor interfaces both</FONT>
<FONT COLOR="#000000">> are internal API. Does our example demonstrate implementation/usage of</FONT>
<FONT COLOR="#000000">> these internal APIs?</FONT>
<FONT COLOR="#000000">> cW</FONT>
<FONT COLOR="#000000">> On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:</FONT>
<FONT COLOR="#000000">>> Hi,</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> I had been messing around with the validation examples and with the help </FONT>
<FONT COLOR="#000000">>> of Christian I was able to get an OCL to be validated against my EMF </FONT>
<FONT COLOR="#000000">>> model. I got this working on a previous version on eclipse, and now trying </FONT>
<FONT COLOR="#000000">>> to get it working on the new version. I notice some of the code has been </FONT>
<FONT COLOR="#000000">>> updated, for example I am the class </FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000"> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService, </FONT>
<FONT COLOR="#000000">>> the IProviderOperationExecutor execute action has changed and now gives a </FONT>
<FONT COLOR="#000000">>> return type 'T', which was previously void. Does anybody have any idea of </FONT>
<FONT COLOR="#000000">>> why this changed and what T is?</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> public IValidator newValidator(EvaluationMode mode) {</FONT>
<FONT COLOR="#000000">>> assert mode != null && !mode.isNull();</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> IProviderOperationExecutor executor = new IProviderOperationExecutor() {</FONT>
<FONT COLOR="#000000">>> public void execute(IProviderOperation op) { < --ERROR - VOID NOT </FONT>
<FONT COLOR="#000000">>> COMPATIABLE </FONT>
<FONT COLOR="#000000">>> MyModelValidationService.this.execute(op);</FONT>
<FONT COLOR="#000000">>> }};</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> if (mode == EvaluationMode.BATCH) {</FONT>
<FONT COLOR="#000000">>> return new BatchValidator(executor);</FONT>
<FONT COLOR="#000000">>> } else if (mode == EvaluationMode.LIVE) {</FONT>
<FONT COLOR="#000000">>> return new LiveValidator(executor);</FONT>
<FONT COLOR="#000000">>> } else {</FONT>
<FONT COLOR="#000000">>> throw new IllegalArgumentException();</FONT>
<FONT COLOR="#000000">>> }</FONT>
<FONT COLOR="#000000">>> }</FONT>
<FONT COLOR="#000000">>> </FONT>
<FONT COLOR="#000000">>> I hope this makes sense - thanks for your help,</FONT>
<FONT COLOR="#000000">>> Mark</FONT>
<FONT COLOR="#000000">>></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-ludr1XHsT4d3mHp2EpQZ--
|
|
|
Goto Forum:
Current Time: Wed Nov 06 00:47:30 GMT 2024
Powered by FUDForum. Page generated in 0.03091 seconds
|