Skip to main content



      Home
Home » Modeling » EMF » [Xcore] Problem with a package starting "http://"
[Xcore] Problem with a package starting "http://" [message #893994] Fri, 06 July 2012 07:14 Go to next message
Eclipse UserFriend
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 07:34 Go to previous message
Eclipse UserFriend
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
Previous Topic:Edit domain of eclipse not providing the child nodes when product is exported
Next Topic:EMF and iBATIS
Goto Forum:
  


Current Time: Wed Jul 02 22:49:49 EDT 2025

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

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

Back to the top