test_class.declarator: jsonValueFactory
test_class.modifier: private
test_class.original_string: private JsonValueFactory jsonValueFactory;
test_class.type: JsonValueFactory
test_class.var_name: jsonValueFactory
test_class.file: everrest-core/src/test/java/org/everrest/core/impl/provider/json/JsonValueFactoryTest.java
test_class.identifier: JsonValueFactoryTest
test_case.body: @UseDataProvider("numericValueData")
      @Test
      public void createsNumericValueFromString(String rawString, boolean isDouble, Number number) throws Exception {
          JsonValue jsonValue = jsonValueFactory.createJsonValue(rawString);
  
          assertEquals(isDouble, jsonValue.isDouble());
          assertEquals(number, jsonValue.getNumberValue());
      }
test_case.class_method_signature: JsonValueFactoryTest.createsNumericValueFromString(String rawString, boolean isDouble, Number number)
test_case.full_signature: @UseDataProvider("numericValueData") @Test public void createsNumericValueFromString(String rawString, boolean isDouble, Number number)
test_case.identifier: createsNumericValueFromString
test_case.invocations: createJsonValue assertEquals isDouble assertEquals getNumberValue
test_case.modifiers: @UseDataProvider("numericValueData") @Test public
test_case.parameters: (String rawString, boolean isDouble, Number number)
test_case.return: void
test_case.signature: void createsNumericValueFromString(String rawString, boolean isDouble, Number number)
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/provider/json/JsonValueFactory.java
focal_class.identifier: JsonValueFactory
focal_class.class_method_signature: JsonValueFactory.createJsonValue(String string)
focal_class.full_signature: public JsonValue createJsonValue(String string)
focal_class.identifier: createJsonValue
focal_class.modifiers: public
focal_class.parameters: (String string)
focal_class.return: JsonValue
focal_class.signature: JsonValue createJsonValue(String string)
focal_method.body: public JsonValue createJsonValue(String string) {
          if (charAtIs(string, 0, '"') && charAtIs(string, string.length() - 1, '"')) {
              return new StringValue(string.substring(1, string.length() - 1));
          } else if ("true".equalsIgnoreCase(string) || "false".equalsIgnoreCase(string)) {
              return new BooleanValue(Boolean.parseBoolean(string));
          } else if ("null".equalsIgnoreCase(string)) {
              return new NullValue();
          } else {
              char c = string.charAt(0);
              if ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+') {
                  if (c == '0') {
                      if (string.length() > 2 && (string.charAt(1) == 'x' || string.charAt(1) == 'X')) {
                          try {
                              return new LongValue(Long.parseLong(string.substring(2), 16));
                          } catch (NumberFormatException notHexNumber) {
                          }
                      } else {
                          try {
                              return new LongValue(Long.parseLong(string.substring(1), 8));
                          } catch (NumberFormatException notOctNumber) {
                              try {
                                  return new LongValue(Long.parseLong(string));
                              } catch (NumberFormatException notLong) {
                                  try {
                                      return new DoubleValue(Double.parseDouble(string));
                                  } catch (NumberFormatException notNumber) {
                                  }
                              }
                          }
                      }
                  } else {
                      try {
                          return new LongValue(Long.parseLong(string));
                      } catch (NumberFormatException notLong) {
                          try {
                              return new DoubleValue(Double.parseDouble(string));
                          } catch (NumberFormatException notNumber) {
                          }
                      }
                  }
              }
          }
          return new StringValue(string);
      }
focal_method.class_method_signature: JsonValueFactory.createJsonValue(String string)
focal_method.full_signature: public JsonValue createJsonValue(String string)
focal_method.identifier: createJsonValue
focal_method.invocations: charAtIs charAtIs length substring length equalsIgnoreCase equalsIgnoreCase parseBoolean equalsIgnoreCase charAt length charAt charAt parseLong substring parseLong substring parseLong parseDouble parseLong parseDouble
focal_method.modifiers: public
focal_method.parameters: (String string)
focal_method.return: JsonValue
focal_method.signature: JsonValue createJsonValue(String string)