Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » package-private visibility?
package-private visibility? [message #890282] Thu, 21 June 2012 18:15 Go to next message
Edwin Park is currently offline Edwin ParkFriend
Messages: 124
Registered: July 2009
Senior Member
Hi,

Xtend makes all def methods public by default, and you can also explicitly specify public/private/protected visibility. However in Java there is a fourth kind of visibility: package-private, which is the default in Java if no explicit visibility modifier is set (http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html).

There is one case where I like to use package-private methods a lot and that is for testing. This way I can put my test classes in the same package as the class under test to get access to internal functionality, but I don't expose these internal functions to the whole world.

Is there any way in Xtend to specify package-private visibility for methods? If not is there some other recommended way to allow test code to access internal functions defined in Xtend classes without making internal stuff public?

Thanks,
Edwin

[Updated on: Thu, 21 June 2012 18:15]

Report message to a moderator

Re: package-private visibility? [message #890286 is a reply to message #890282] Thu, 21 June 2012 18:29 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=378267

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:ContentAssist with @-Symbol
Next Topic:XbaseWithAnnotations
Goto Forum:
  


Current Time: Sat Apr 20 00:02:44 GMT 2024

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

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

Back to the top