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

Discussion in 'Java' started by Martin Burger, Jun 30, 2005.

  1. Martin Burger, Jun 30, 2005
    #1
    1. Advertising

  2. Martin Burger

    Roland Guest

    Re: Utility class to check validity of package, class, and methodname

    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_/ /__/
    / \ /_/ / \
    Roland, Jun 30, 2005
    #2
    1. Advertising

  3. Hello Roland!

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

    :)

    Regards,
    Martin
    Martin Burger, Jun 30, 2005
    #3
  4. Martin Burger

    Roland Guest

    Re: Utility class to check validity of package, class, and methodname

    On 30-6-2005 14:35, Martin Burger wrote:
    > 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_/ /__/
    / \ /_/ / \
    Roland, Jun 30, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rex_chaos
    Replies:
    3
    Views:
    322
    tom_usenet
    Oct 28, 2003
  2. Ian
    Replies:
    2
    Views:
    341
    Ulrich Petri
    Sep 6, 2003
  3. shuisheng
    Replies:
    2
    Views:
    334
    Jerry Coffin
    Feb 16, 2007
  4. Merrycoder

    check validity of a controls property at compile time

    Merrycoder, Apr 17, 2008, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    738
    Peter Bucher [MVP]
    May 1, 2008
  5. Chris
    Replies:
    7
    Views:
    146
    sisyphus
    Nov 18, 2010
Loading...

Share This Page