I am constructing some Java library.

I designed many methods to be required in future but could only implement part of them at now.

What is the best (or better) way to make library users notice that those functions will be supported but have not been implemented yet.(I don't like to erase all unimplemented methods from the sources.)

One idea is to make my own NetYetImplementedException as a child of RuntimeException. But it is strange for me that this kind of exception does not seem to be prepared in core library, or are there?

reference to other good sample, articles about exception designing are also welcome.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think that you might want ot use the:    
java.lang.NoSuchMethodException .        

     Best way to do this is to define your own Exception class with the proper error message and throw that exception in the not implemented methods.

   In JDK APIs also there are a lot of methods not implemented and they throw the RuntimeException. There are a lot of examples, but I am able to remeber just one at present and I am giving that here:

In java.sql.PreparedStatement, if you try to set the Date parameter like this:
PreparedStatement stat = conn.prepareStatement("SELECT * FROM Test WHERE Date=?");
stat.setDate(1, new java.sql.Date(1999, 11, 29), new GregorianCalendar());

throws a following RuntimeException:
java.lang.UnsupportedOperationException at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(JdbcOdbcPreparedState
        at NotImplemented.<init>(
        at NotImplemented.main(

Actually the Runtime exception is thrown in a no. of classes in JDK API, but there is not a single Exception class defined for that. Everywhere it's implementation dependent.

Hope this helps.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Working with the NoSuchMethodException
or semiliar will prevent the Use of this method while developing because the
developer will have to compose a try catch block inorder to use the unsupported method, I preffer to use it this way inorder to protected the API users, but you can either use Atif sulotion.

akky032499Author Commented:
Thanks atifmk, Buglighter

I knew both suggested ways but now you let me know there are no other proper way.

I may use UnsupportedOperationException for my case instead of creating my own.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.