Results 1 to 2 of 2
  1. #1
    jwilley44 is offline Member
    Join Date
    Jan 2009
    Rep Power

    Default Annotations to change access level of method


    Even though I am not an advanced user I think this is may be an advanced topic (feel free to correct me). I was wondering if an annotation exists that would allow a method (or field) to change its level of access for specific types of methods or classes? For example if you have methods that you want to be private but would like to run Junit tests on them. If it does not exist is possible to create one? Also if this idea seems completely unreasonable or useless let me know why?

    Thanks in advance.

  2. #2
    Join Date
    Oct 2008
    Rep Power


    Not sure if this is what you are looking for. But if you want to do unit testing of private methods then you may use Reflection hack for calling private methods on java see Hacking Private Methods

    Cooking is Fun| Eat Healthy Stay Fit | Sweets | Raita | Bread | Dal| Snacks

Similar Threads

  1. multiple threads access the same method.
    By bhanu in forum New To Java
    Replies: 3
    Last Post: 02-16-2009, 07:54 AM
  2. Method access or field access
    By carderne in forum New To Java
    Replies: 2
    Last Post: 12-06-2008, 07:20 PM
  3. Row level locking........
    By jithan in forum New To Java
    Replies: 0
    Last Post: 09-02-2008, 08:09 AM
  4. row level locking
    By jithan in forum New To Java
    Replies: 1
    Last Post: 08-28-2008, 07:42 PM
  5. Field Level Security
    By narayanasgs in forum Web Frameworks
    Replies: 0
    Last Post: 05-30-2008, 09:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts