Java Class Name Format classToSignatureIdentifier(Class clazz)

Here you can find the source of classToSignatureIdentifier(Class clazz)

Description

class To Signature Identifier

License

Apache License

Declaration

private static String classToSignatureIdentifier(Class clazz) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static String classToSignatureIdentifier(Class clazz) {
        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";
        } else if (clazz == short.class) {
            return (clazz.isArray() ? "[" : "") + "S";
        } else if (clazz == int.class) {
            return (clazz.isArray() ? "[" : "") + "I";
        } else if (clazz == float.class) {
            return (clazz.isArray() ? "[" : "") + "F";
        } else if (clazz == double.class) {
            return (clazz.isArray() ? "[" : "") + "D";
        } else if (clazz == void.class) {
            return (clazz.isArray() ? "[" : "") + "V";
        } else {/*from  ww  w  . j  a va  2  s.  c o m*/
            return (clazz.isArray() ? "[" : "") + "L" + clazz.getName().replace(".", "/") + ";";
        }
    }
}

Related

  1. classToPath(Class clazz)
  2. classToPath(String name, boolean resource)
  3. classToResource(String className)
  4. classToResourceKeyPrefix(final Class clazz)
  5. classToResourceName(Class clazz)
  6. classToSlashed(String className)
  7. classToString(Class c)
  8. classToString(Class clazz)
  9. classToString(Class[] array, String separator, String defaultValue)