• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

interface visibility in sub-packages only

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have interface -> I in package test



I want this interface to be accessible in sub-packages only(say test.sub ), not outside package-test
Making this inteface public make it visible in sub-packages but it also make it visible in other packages.

Is it possible to do this ??
if yes then how can achieve it ??

Thanks,
Nrapendra

 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java doesn't really have the notion of "subpackages", at least not at the language level (some of the security mechanisms could be said to work in terms of subpackages.) There's no way to do what you're asking.

If you explain what you actually want to accomplish, maybe we could offer some suggestions.
 
Marshal
Posts: 77249
371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that is possible as you describe it. Java has much less granularity of access control than some languages (eg Eiffel).
 
Nrapendra Sharma
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for quick reply:
Here is my problem in detail :-
I have a module for importing data from different sources.
There are two main interface in this module (I1,I2). I1 is for other modules by which they will access my module and I2 for inter-modules implementation's (depanding on source of imports) that can increase lateron. I want that no other module should access (or no one can use) the interface I2. Only Interface I1 and the default implementations should be visible to other module.

Regard,
Nrapendra
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic