Java Utililty Methods Class Name Convert To

List of utility methods to do Class Name Convert To

Description

The list of methods to do Class Name Convert To are organized into topic(s).

Method

StringclassNameToAsm(Class c1ass)
class Name To Asm
return classNameToAsm(c1ass.getName());
StringclassNameToConstant(String className)
class Name To Constant
return camelCaseNameToConstant(className);
StringclassNameToDirectoryName(final Class targetClass)
class Name To Directory Name
return targetClass.getName().replace('.', '/') + "/";
StringclassnameToFilename(String classname)
classname To Filename
if (classname == null)
    throw new IllegalArgumentException("Class name is null");
if (!classname.startsWith("/")) {
    classname = "/" + classname;
classname = classname.replace('.', '/'); 
classname = classname + ".class";
return classname;
...
StringclassNameToFilePath(String className)
class Name To File Path
String str;
if (className.indexOf(".") < 0) {
    return className;
} else {
    str = className.replaceAll("\\.", "/");
return str;
StringclassNameToFullyQualifiedClassName(String packageName, String className)
class Name To Fully Qualified Class Name
return (packageName.length() > 0 ? packageName + "." + className : className).replace(".", "/");
StringclassNameToInternalClassName(String className)
Will convert a class name to its name in the class definition format (e.g org.objenesis.EmptyClass becomes org/objenesis/EmptyClass )
return className.replace('.', '/');
StringclassNameToJavaPath(String name)
class Name To Java Path
return (name.replace(FQN_SEPARATOR, PATH_SEPERATOR) + ".java");
StringclassNameToJavaUri(String className)
class Name To Java Uri
return className.replace('.', '/').concat(DOT_JAVA);
StringclassNameToPackageName(String fqn)
class Name To Package Name
int lastSeparatorPos = fqn.lastIndexOf(FQN_SEPARATOR);
if (lastSeparatorPos == -1)
    return null;
else
    return fqn.substring(0, lastSeparatorPos);