org.exolab.javasource
Class JNaming
java.lang.Object
org.exolab.javasource.JNaming
public final class JNaming
extends java.lang.Object
A utility class used to validate identifiers and class names.
$Revision: 6669 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $static String | getLocalNameFromClassName(String className) - Returns the local class name from the given fully qualified class name.
|
static String | getPackageFromClassName(String className) - Returns the package name from the given class name.
|
static boolean | isInJavaLang(String name) - Returns true if the given String is a Java class in java.lang.* which
will cause a problem when used as a variable name.
|
static boolean | isKeyword(String name) - Returns true if the given String is a Java keyword which will cause a
problem when used as a variable name.
|
static boolean | isParameterizedCollectionsObject(String name) - Returns true if the given String is a parameterized Java collection.
|
static boolean | isReservedByCastor(String name) - Returns true if the given String is a reserved name by Castor which may
cause a problem when used as a variable name.
|
static boolean | isReservedByWindows(String name) - Returns true if the given String is a reserved name by the Windows
filesystem which will cause a problem when used as a class name under
Windows.
|
static boolean | isValidJavaIdentifier(String string) - Returns true if the given String matches the production of a valid Java
identifier.
|
getLocalNameFromClassName
public static String getLocalNameFromClassName(String className)
Returns the local class name from the given fully qualified class name.
className
- An arbitrary class name, optionally including a package.
- The local name from the given class name.
getPackageFromClassName
public static String getPackageFromClassName(String className)
Returns the package name from the given class name.
className
- An arbitrary class name, optionally including a package.
- The package name from the given class name.
isInJavaLang
public static boolean isInJavaLang(String name)
Returns true if the given String is a Java class in java.lang.* which
will cause a problem when used as a variable name.
name
- The String to check against the list of keywords.
- True if the given String is a Java class in java.lang.* which
will cause a problem when used as a variable name.
isKeyword
public static boolean isKeyword(String name)
Returns true if the given String is a Java keyword which will cause a
problem when used as a variable name.
name
- The String to check against the list of keywords.
- True if the given String is a Java keyword which will cause a
problem when used as a variable name.
isParameterizedCollectionsObject
public static boolean isParameterizedCollectionsObject(String name)
Returns true if the given String is a parameterized Java collection.
object keyword which will cause a problem when used as a variable name
name
- The String to check as a parameterized Java collection.
- True if the given String is a parameterized Java collection
object keyword which will cause a problem when used as a variable
name.
isReservedByCastor
public static boolean isReservedByCastor(String name)
Returns true if the given String is a reserved name by Castor which may
cause a problem when used as a variable name. Some fields that Castor
uses depend on the contents of the schema, so we only warn.
name
- The String to check against the list of keywords.
- True if the given String is a reserved name by Castor which may
cause a problem when used as a variable name.
isReservedByWindows
public static boolean isReservedByWindows(String name)
Returns true if the given String is a reserved name by the Windows
filesystem which will cause a problem when used as a class name under
Windows.
name
- The String to check against the list of keywords.
- True if the given String is a reserved name by Castor which may
cause a problem when used as a variable name.
isValidJavaIdentifier
public static boolean isValidJavaIdentifier(String string)
Returns true if the given String matches the production of a valid Java
identifier.
string
- The String to check the production of.
- True if the given String matches the production of a valid Java
name, otherwise false.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com