Here you can find the source of quoteValues(String value)
public static String quoteValues(String value)
//package com.java2s; public class Main { public static String quoteValues(String value) { if (value.equals("true")) return "\"true\"^^xsd:boolean"; if (value.equals("false")) return "\"false\"^^xsd:boolean"; // Short circuit: not numeric if (value.startsWith("\"") || (value.length() > 0 && Character.isLetter(value.charAt(0)))) return value; // Try to convert to integer try {//w w w . j ava2 s. c om Integer.parseInt(value); return "\"" + value + "\"^^xsd:int"; } catch (NumberFormatException e) { } // Try to convert to double try { Double.parseDouble(value); return "\"" + value + "\"^^xsd:double"; } catch (NumberFormatException e) { } return value; } public static int parseInt(String arg2) { if (!arg2.endsWith("^^xsd:int")) throw new RuntimeException("Arg2 is not a valid integer: " + arg2); int closingQuoteIndex = arg2.lastIndexOf('"'); return Integer.parseInt(arg2.substring(1, closingQuoteIndex)); } }