Java Utililty Methods Class Name Format

List of utility methods to do Class Name Format

Description

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

Method

StringclassToResourceName(Class clazz)
Get the resource name for the class file for the given class
return classNameToResourceName(clazz.getName());
StringclassToSignatureIdentifier(Class clazz)
class To Signature Identifier
if (clazz == null) {
    return "";
} else if (clazz == boolean.class) {
    return (clazz.isArray() ? "[" : "") + "Z";
} else if (clazz == byte.class) {
    return (clazz.isArray() ? "[" : "") + "B";
} else if (clazz == char.class) {
    return (clazz.isArray() ? "[" : "") + "C";
...
StringclassToSlashed(String className)
class To Slashed
if (className == null)
    return null;
return className.replace('.', '/');
StringclassToString(Class c)
Turns a class into a string.
String result;
int dim;
int i;
if (c.isArray()) {
    dim = getArrayDimensions(c);
    result = getArrayClass(c).getName();
    for (i = 0; i < dim; i++)
        result += ARRAY_INDICATOR;
...
StringclassToString(Class clazz)
class To String
if (clazz.isArray())
    return classToString(clazz.getComponentType()) + "[]";
if (clazz.isPrimitive())
    return clazz.toString();
return clazz.getSimpleName();
StringclassToString(Class[] array, String separator, String defaultValue)
class To String
if (null == array) {
    return defaultValue;
} else {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < array.length; i++) {
        if (result.length() > 0) {
            result.append(separator);
        result.append(array[i].getName());
    return result.toString();
StringclassToString(Class[] cArr)
class To String
String retVal = "";
if (cArr != null) {
    for (Class c : cArr) {
        retVal += "\t" + c.getName() + "\n";
return retVal;
StringclassToString(int clasS)
class To String
switch (clasS) {
case 1:
    return "IN";
case 2:
    return "CS";
case 3:
    return "CH";
case 4:
...
StringclassToStringRepresentation(Class c)
class To String Representation
if (void.class.equals(c)) {
    return "V";
} else if (byte.class.equals(c)) {
    return "B";
} else if (char.class.equals(c)) {
    return "C";
} else if (double.class.equals(c)) {
    return "D";
...
StringclassToXMLName(Class klass)
class To XML Name
return dasherize(klass.getSimpleName()).toLowerCase();