}
public RestVariable createRestVariable(String name, Object value, RestVariableScope scope,
String id, int variableType, boolean includeBinaryValue, String serverRootUrl) {
RestVariableConverter converter = null;
RestVariable restVar = new RestVariable();
restVar.setVariableScope(scope);
restVar.setName(name);
if (value != null) {
// Try converting the value
for (RestVariableConverter c : variableConverters) {
if (c.getVariableType().isAssignableFrom(value.getClass())) {
converter = c;
break;
}
}
if (converter != null) {
converter.convertVariableValue(value, restVar);
restVar.setType(converter.getRestTypeName());
} else {
// Revert to default conversion, which is the serializable/byte-array form
if (value instanceof Byte[] || value instanceof byte[]) {
restVar.setType(BYTE_ARRAY_VARIABLE_TYPE);
} else {