return results;
}
private NativeObject toJsObject(String options) {
NativeObject nativeOptions = new NativeObject();
for (final String nextOption : options.split(",")) {
final String option = nextOption.trim();
if(!option.isEmpty()){
final String name;
final Object value;
final int valueDelimiter = option.indexOf(':');
if(valueDelimiter==-1){
name = option;
value = Boolean.TRUE;
} else {
name = option.substring(0, valueDelimiter);
String rest = option.substring(valueDelimiter+1).trim();
if (rest.matches("[0-9]+")) {
value = Integer.parseInt(rest);
} else if (rest.equals("true")) {
value = Boolean.TRUE;
} else if (rest.equals("false")) {
value = Boolean.FALSE;
} else {
value = rest;
}
}
nativeOptions.defineProperty(name, value, NativeObject.READONLY);
}
}
return nativeOptions;
}