Converts the given type signature to a human readable type string.
<p>
Example: {@code Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>; -> java.util.Map<java.lang.String, java.lang.String>}
773203
public static String toReadableType(final String type) {
        final SignatureReader reader = new SignatureReader(type);
        final TraceSignatureVisitor visitor = new TraceSignatureVisitor(0);
        reader.acceptType(visitor);
        return visitor.getDeclaration();
    }
767238
public static String typeValueString(final Object value) {
        StringBuilder sb = new StringBuilder(valueString(value));
        return sb.append(" :").append(typeString(value)).toString();
    }
587160
public StringBuilder appendTypeSignature(JvmType type, StringBuilder result) {
		result.append(type.getSimpleName());
		if(type instanceof JvmTypeParameterDeclarator) {
			List<JvmTypeParameter> typeParameters = ((JvmTypeParameterDeclarator) type).getTypeParameters();
			if (!typeParameters.isEmpty()) {
				result.append("<");
				for(int i = 0, size = typeParameters.size(); i < size; i++) {
					if (i != 0) {
						result.append(", ");
					}
					result.append(typeParameters.get(i).getName());
				}
				result.append(">");
			}
		}
		return result;
	}
420912
public static String toClassName(final String type) {
        switch (type.charAt(0)) {
            case 'V':
                return CLASS_PRIMITIVE_VOID;
            case 'Z':
                return CLASS_PRIMITIVE_BOOLEAN;
            case 'C':
                return CLASS_PRIMITIVE_CHAR;
            case 'B':
                return CLASS_PRIMITIVE_BYTE;
            case 'S':
                return CLASS_PRIMITIVE_SHORT;
            case 'I':
                return CLASS_PRIMITIVE_INT;
            case 'F':
                return CLASS_PRIMITIVE_FLOAT;
            case 'J':
                return CLASS_PRIMITIVE_LONG;
            case 'D':
                return CLASS_PRIMITIVE_DOUBLE;
            case 'L':
                final int typeParamStart = type.indexOf('<');
                final int endIndex = typeParamStart >= 0 ? typeParamStart : type.indexOf(';');
                return type.substring(1, endIndex);
            case '[':
            case '+':
            case '-':
                return toClassName(type.substring(1));
            case 'T':
                // TODO handle type variables
                return CLASS_OBJECT;
            default:
                throw new IllegalArgumentException("Not a type signature: " + type);
        }
    }
1224814
protected StyledString getHumanReadableName(JvmTypeReference reference) {
		if (reference == null) {
			return new StyledString("Object"); //$NON-NLS-1$
		}
		final String name = this.uiStrings.referenceToString(reference, "Object"); //$NON-NLS-1$
		return convertToStyledString(name);
	}
1026795
private String getTypeString(Class<?> c)
   {
      String result = TYPE_MAP.get(c);
      if (result == null)
      {
         result = c.getName();
         if (!result.endsWith(";") && !result.startsWith("["))
         {
            result = "L" + result + ";";
         }
      }
      return result;
   }
301189
private String makeSignature(List<ASTType> paramTypes) {
        StringBuilder builder = new StringBuilder();
        builder.append('(');
        for (ASTType paramType : paramTypes) {
            makeTypeDescriptor(builder, paramType);
        }

        builder.append(')');
        return builder.toString();
    }
1249448
public String getEncodingByMimeType(String type)
    {
        String encoding =null;

        if (type!=null)
            encoding=(String)_encodingMap.get(type);

        return encoding;
    }
630612
def type_to_string(f, map_types):
    
    if f.type in [1]:
        return "double"
    elif f.type in [2]:
        return "float"
    elif f.type in [3]:
        return "long"
    elif f.type in [4]:
        return "uint64"
    elif f.type in [5]:
        return "integer"
    elif f.type in [6]:
        return "fixed64"
    elif f.type in [7]:
        return "fixed32"
    elif f.type in [8]:
        return "boolean"
    elif f.type in [9]:
        return "string"
    # missing type 10 - Group
    elif f.type in [11, 14]:
        ref_name = f.ref_type
        if ref_name in map_types:
            ref_fields = map_types[ref_name]
            return {
                "type": "map",
                "key": " %s "% type_to_string(ref_fields["key"], map_types),
                "value": " %s "% type_to_string(ref_fields["value"], map_types)
            }
        else:
            kind = ":protobuf:message:`%s`" % simplify_name(f.ref_type)
            if f.label == 3: # LABEL_REPEATED
                return "list of " + kind
            else:
                return kind
    elif f.type in [12]:
        return "bytes"
    elif f.type in [13]:
        return "uint32"
    elif f.type in [15]:
        return "sfixed32"
    elif f.type in [16]:
        return "sfixed64"
    elif f.type in [17]:
        return "sint32"
    elif f.type in [18]:
        return "sint64"
    else:
        raise Exception, f.type
1035264
public String stringify() {
        if (type == TokenType.TEXT) {
            return defaultValue;
        }
        StringBuilder sb = new StringBuilder();
        if (type == TokenType.BEAN) {
            sb.append(BEAN_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
            if (value != null) {
                sb.append(VALUE_SEPARATOR);
                sb.append(value);
            }
            if (getterName != null) {
                sb.append(GETTER_SEPARATOR);
                sb.append(getterName);
            }
        } else if (type == TokenType.TEMPLATE) {
            sb.append(TEMPLATE_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
        } else if (type == TokenType.PARAMETER) {
            sb.append(PARAMETER_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
        } else if (type == TokenType.ATTRIBUTE) {
            sb.append(ATTRIBUTE_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
            if (getterName != null) {
                sb.append(GETTER_SEPARATOR);
                sb.append(getterName);
            }
        } else if (type == TokenType.PROPERTY) {
            sb.append(PROPERTY_SYMBOL);
            sb.append(START_BRACKET);
            if (name != null) {
                sb.append(name);
            }
            if (value != null) {
                sb.append(VALUE_SEPARATOR);
                sb.append(value);
            }
            if (getterName != null) {
                sb.append(GETTER_SEPARATOR);
                sb.append(getterName);
            }
        } else {
            throw new InvalidTokenException("Unknown token type: " + type, this);
        }
        if (defaultValue != null) {
            sb.append(VALUE_SEPARATOR);
            sb.append(defaultValue);
        }
        sb.append(END_BRACKET);
        return sb.toString();
    }
44332
public Map<String, String> toStringMap() {
    Map<String, String> map = new HashMap<>();
    for (Map.Entry<String, Object> entry : entrySet()) {
      map.put(entry.getKey(), String.valueOf(entry.getValue()));
    }
    return map;
  }
4205
public ClassTypeSignature getTypeSignature() {
        if (typeSignatureStr == null) {
            return null;
        }
        if (typeSignature == null) {
            try {
                typeSignature = ClassTypeSignature.parse(typeSignatureStr, this);
                typeSignature.setScanResult(scanResult);
            } catch (final ParseException e) {
                throw new IllegalArgumentException(e);
            }
        }
        return typeSignature;
    }
988577
@Nullable
    public static String classToSignature(String className) {
        if (className == null) {
            return null;
        } else if (className.startsWith(Values.SIG_ARRAY_PREFIX)) {
            // convert the classname inside the array
            return Values.SIG_ARRAY_PREFIX + classToSignature(className.substring(Values.SIG_ARRAY_PREFIX.length()));
        } else if (PRIMITIVE_TYPES.contains(className) || className.endsWith(Values.SIG_QUALIFIED_CLASS_SUFFIX)) {
            return className.replace('.', '/');
        } else {
            String primitive = PRIMITIVE_NAME_TO_SIG.get(className);
            if (primitive != null) {
                return primitive;
            }

            return Values.SIG_QUALIFIED_CLASS_PREFIX + className.replace('.', '/') + Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR;
        }
    }
421257
public static String mapToJSONString(Map<?, ?> map) {
		if (map == null || map.size() == 0) {
			return "{}";
		}
		StringBuilder sb = new StringBuilder("{");
		for (Object o : map.entrySet()) {
			Entry<?, ?> e = (Entry<?, ?>) o;
			buildAppendString(sb, e.getKey()).append('=');
			buildAppendString(sb, e.getValue()).append(',').append(' ');
		}
		return sb.delete(sb.length() - 2, sb.length()).append('}').toString();
	}
1033993
public String getTypeSignature(String javasignature, TypeMirror returnType)
            throws SignatureException {
        String signature = null; //Java type signature.
        String typeSignature = null; //Internal type signature.
        List<String> params = new ArrayList<>(); //List of parameters.
        String paramsig = null; //Java parameter signature.
        String paramJVMSig = null; //Internal parameter signature.
        String returnSig = null; //Java return type signature.
        String returnJVMType = null; //Internal return type signature.
        int dimensions = 0; //Array dimension.

        int startIndex = -1;
        int endIndex = -1;
        StringTokenizer st = null;
        int i = 0;

        // Gets the actual java signature without parentheses.
        if (javasignature != null) {
            startIndex = javasignature.indexOf("(");
            endIndex = javasignature.indexOf(")");
        }

        if (((startIndex != -1) && (endIndex != -1))
            &&(startIndex+1 < javasignature.length())
            &&(endIndex < javasignature.length())) {
            signature = javasignature.substring(startIndex+1, endIndex);
        }

        // Separates parameters.
        if (signature != null) {
            if (signature.contains(",")) {
                st = new StringTokenizer(signature, ",");
                if (st != null) {
                    while (st.hasMoreTokens()) {
                        params.add(st.nextToken());
                    }
                }
            } else {
                params.add(signature);
            }
        }

        /* JVM type signature. */
        typeSignature = "(";

        // Gets indivisual internal parameter signature.
        while (params.isEmpty() != true) {
            paramsig = params.remove(i).trim();
            paramJVMSig  = getParamJVMSignature(paramsig);
            if (paramJVMSig != null) {
                typeSignature += paramJVMSig;
            }
        }

        typeSignature += ")";

        // Get internal return type signature.

        returnJVMType = "";
        if (returnType != null) {
            dimensions = dimensions(returnType);
        }

        //Gets array dimension of return type.
        while (dimensions-- > 0) {
            returnJVMType += "[";
        }
        if (returnType != null) {
            returnSig = qualifiedTypeName(returnType);
            returnJVMType += getComponentType(returnSig);
        } else {
            System.out.println("Invalid return type.");
        }

        typeSignature += returnJVMType;

        return typeSignature;
    }
1347131
public static String getJavaEncoding(String iana) {
        String IANA = iana.toUpperCase();
        String jdec = (String)map.get(IANA);
        if (jdec == null)
            jdec = iana;
        return jdec;
    }
137170
public static Type typeFromString(String type) {
        final PrimitiveType primitive = PrimitiveType.fromName(type);
        if (primitive != null) {
            return primitive.getKeyClass();
        }
        try {
            return loadClassByName(type);
        } catch (Exception e) {
            //LOGGER.error(String.format("Failed to resolve '%s' into class", type), e);
        }
        return null;
    }