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

R

Roland

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
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#isJavaIdentifierStart(char)>

isJavaIdentifierPart
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#isJavaIdentifierPart(char)>
--
Regards,

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

Martin Burger

Hello Roland!

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

:)

Regards,
Martin
 
R

Roland

Hello Roland!

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

:)

Regards,
Martin
Just a wild guess: maybe some class/es in the com.sun.tools.javac.*
package hierarchy :p
--
Regards,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top