< V > String toJson ( final DataTypeDescriptor < V > descriptor , final V arg ) { String s = format . write ( arg , descriptor , false ) ; TypeEnum type = descriptor . getType ( ) ; if ( type == TypeEnum . STRING || type == TypeEnum . ENUM || type == TypeEnum . DATETIME ) { // Remove the quotes. s = s . substring ( 1 , s . length ( ) - 1 ) ; } return s ; }
Serializes an argument to JSON strips the quotes .