Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] Problem with a package starting "http://"
[Xcore] Problem with a package starting "http://" [message #893994] Fri, 06 July 2012 11:14 Go to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Is there a way to specify a package named "http://www.eclipse.org/xcore" in Xcore because it currently gives me the following error: "missing EOF at ':'".

@GenModel(basePackage="org.eclipse.xcore")
package http://www.eclipse.org/xcore


It seems that with Xcore we should use uri like "org.eclipse.xcore" but my application uses an uri handler and an uri like is converted during the resolution since it is detected as a relative uri.


org.eclipse.emf.common.util.URI.createURI("org.eclipse.xcore").resolve(org.eclipse.emf.common.util.URI.createFileURI("C:\\some\\stuff\\here"))
RESULT:	 (org.eclipse.emf.common.util.URI) file:/C:/some/stuff/org.eclipse.xcore

org.eclipse.emf.common.util.URI.createURI("http://www.eclipse.org/xcore").resolve(org.eclipse.emf.common.util.URI.createFileURI("C:\\some\\stuff\\here"))
RESULT:	 (org.eclipse.emf.common.util.URI) http://www.eclipse.org/xcore


Regards,

Stephane Begaudeau
Re: [Xcore] Problem with a package starting "http://" [message #894002 is a reply to message #893994] Fri, 06 July 2012 11:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Stephane,

Comments below.

On 06/07/2012 1:14 PM, Stephane Begaudeau wrote:
> Hi,
>
> Is there a way to specify a package named
> "http://www.eclipse.org/xcore" in Xcore because it currently gives me
> the following error: "missing EOF at ':'".
>
> @GenModel(basePackage="org.eclipse.xcore")
> package http://www.eclipse.org/xcore
>
> It seems that with Xcore we should use uri like "org.eclipse.xcore"
> but my application uses an uri handler and an uri like is converted
> during the resolution since it is detected as a relative uri.
You're trying to specify the EPackage.nsURI. You can use @Ecore
annotations for things like the nsPrefix and the nsURI.

@Ecore(nsURI="http://whatever", nsPrefix="whatever")
package org.example.tree

The XPackage name itself must always be a qualified name; the last
segment determines the EPackage.name and the renaming segments determine
the GenPackage.basePackage.
>
> org.eclipse.emf.common.util.URI.createURI("org.eclipse.xcore").resolve(org.eclipse.emf.common.util.URI.createFileURI("C:\\some\\stuff\\here"))
>
> RESULT: (org.eclipse.emf.common.util.URI)
> file:/C:/some/stuff/org.eclipse.xcore
>
> org.eclipse.emf.common.util.URI.createURI("http://www.eclipse.org/xcore").resolve(org.eclipse.emf.common.util.URI.createFileURI("C:\\some\\stuff\\here"))
>
> RESULT: (org.eclipse.emf.common.util.URI)
> http://www.eclipse.org/xcore
>
> Regards,
>
> Stephane Begaudeau


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Edit domain of eclipse not providing the child nodes when product is exported
Next Topic:EMF and iBATIS
Goto Forum:
  


Current Time: Thu Apr 18 21:13:57 GMT 2024

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

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

Back to the top