Re: Utility class to check validity of package, class, and method name
On 30-6-2005 11:56, Martin Burger wrote:
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_/ /__/
/ \ /_/ / \
.
Relevant Pages
- Utility class to check validity of package, class, and method name
... is there any utility class to check the validity of package, class, and ... method names given as String? ... In terms of the the Java Language Specification, ... (comp.lang.java.programmer) - Re: #include for a DropDownList?
... another option would be define a utility class ... drag a ObjectDataSource on the page and use ObjectDataSource to reference ... I had to put "static public string ServiceUrl" or the jscript below would ... (microsoft.public.dotnet.framework.aspnet.webcontrols) - Re: How to count duplicate items in ArrayList?
... Ook wrote: ... Map<String,int> would be ideal for another part of this project, but I'm using a class with a string and int because thats how I did it in c++ and I don't know java well enough to make the Map work (it's a school project). ... to do something like this often enough that I have a utility class to do it. ... (comp.lang.java.programmer) |
|