Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to validate wildcard package import
How to validate wildcard package import [message #1746280] Wed, 26 October 2016 12:15 Go to next message
Andrey Petrenko is currently offline Andrey PetrenkoFriend
Messages: 8
Registered: March 2016
Junior Member
Is it possible to validate imports like

import xava.util.*

I want to highlight error message that there is no such package 'xava.util'

I know that I can validate member import rule like

Import:
'import' name=[type::JvmType|QualifiedName] wildcard?='.*'?


In that case, if someone input wrong type scope returns null and validator highlight error.

But in the case of package wild card import name can be any string.

Btw xtend just shows warning message that wild card import are deprecated
Re: How to validate wildcard package import [message #1746444 is a reply to message #1746280] Fri, 28 October 2016 18:53 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 67
Registered: January 2016
Location: Kiel
Member

The common types EPackage doesn't 'model' any Java packages, so you can not have cross references to them.
But if you have a source to tell you whether such a package exists (e.g. JDT), you can write a validation rule and check it.
Previous Topic:Embeded single line editor
Next Topic:cross-project references not resolved in standalone mode
Goto Forum:
  


Current Time: Thu Mar 30 07:04:20 GMT 2017

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

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