Skip to main content

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' 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: 83
Registered: January 2016
Location: Kiel

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:JvmTypesBuilder extension injection does not work in static inner classes
Goto Forum:

Current Time: Fri Jun 02 09:20:56 GMT 2023

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

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

Back to the top