Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Utility class to check validity of package, class, and method name

Thread view: 
Martin Burger - 30 Jun 2005 10:56 GMT
Hello,

is there any utility class to check the validity of package, class, and
method names given as String?

Valid: In terms of the the Java Language Specification, especially
http://java.sun.com/docs/books/jls/first_edition/html/3.doc.html#40625?

Thanks,
   Martin
Roland - 30 Jun 2005 13:05 GMT
> Hello,
>
[quoted text clipped - 6 lines]
> Thanks,
>     Martin

Don't know of a method that checks an entire string, but the Character
class has static methods for validation of java identifiers:

isJavaIdentifierStart
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#isJavaIdentifie
rStart(char
)>

isJavaIdentifierPart
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#isJavaIdentifie
rPart(char
)>
Signature

Regards,

Roland de Ruiter
` ___      ___
`/__/ w_/ /__/
/  \ /_/ /  \

Martin Burger - 30 Jun 2005 13:35 GMT
Hello Roland!

I hope there's any class that implemented a check using exactly the
methods mentioned by you.

:-)

Regards,
Martin
Roland - 30 Jun 2005 13:47 GMT
> Hello Roland!
>
[quoted text clipped - 5 lines]
> Regards,
> Martin

Just a wild guess: maybe some class/es in the com.sun.tools.javac.*
package hierarchy :-P
Signature

Regards,

Roland de Ruiter
` ___      ___
`/__/ w_/ /__/
/  \ /_/ /  \



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.