|package-private visibility? [message #890282]
||Thu, 21 June 2012 18:15
| Edwin Park
Registered: July 2009
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?
[Updated on: Thu, 21 June 2012 18:15]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01785 seconds