}
}
protected void addValueToArray(Level level, Object value, QName schemaType){
JsonArrayBuilder jsonArrayBuilder = level.getJsonArrayBuilder();
if(value == NULL){
jsonArrayBuilder.addNull();
}else if(value instanceof Integer){
jsonArrayBuilder.add((Integer)value);
}else if(value instanceof BigDecimal){
jsonArrayBuilder.add((BigDecimal)value);
}else if(value instanceof BigInteger){
jsonArrayBuilder.add((BigInteger)value);
}else if(value instanceof Boolean){
jsonArrayBuilder.add((Boolean)value);
}else if(value instanceof Character){
jsonArrayBuilder.add((Character)value);
}else if(value instanceof Double){
jsonArrayBuilder.add((Double)value);
}else if(value instanceof Float){
jsonArrayBuilder.add((Float)value);
}else if(value instanceof Long){
jsonArrayBuilder.add((Long)value);
}else if(value instanceof String){
jsonArrayBuilder.add((String)value);
}else{
ConversionManager conversionManager = getConversionManager();
String convertedValue = (String) conversionManager.convertObject(value, CoreClassConstants.STRING, schemaType);
Class theClass = conversionManager.javaType(schemaType);
if((schemaType == null || theClass == null) && (CoreClassConstants.NUMBER.isAssignableFrom(value.getClass()))){
//if it's still a number and falls through the cracks we dont want "" around the value
BigDecimal convertedNumberValue = ((BigDecimal) ((ConversionManager) session.getDatasourcePlatform().getConversionManager()).convertObject(value, CoreClassConstants.BIGDECIMAL, schemaType));
jsonArrayBuilder.add((BigDecimal)convertedNumberValue);
}else{
jsonArrayBuilder.add(convertedValue);
}
}
}