* Returns the JSON format of this parameter configuration
*/
public String toJson() {
if (parameterType.isEnum()) {
String typeName = "string";
CollectionStringBuffer sb = new CollectionStringBuffer();
for (Object value : parameterType.getEnumConstants()) {
sb.append(doubleQuote(value.toString()));
}
return doubleQuote(name) + ": { \"type\": " + doubleQuote(typeName)
+ ", \"javaType\": \"" + parameterType.getCanonicalName() + "\""
+ ", \"enum\": [ " + sb.toString() + " ] }";
} else if (parameterType.isArray()) {
String typeName = "array";
return doubleQuote(name) + ": { \"type\": " + doubleQuote(typeName)
+ ", \"javaType\": \"" + parameterType.getCanonicalName() + "\" }";
} else {