test_class.declarator: converter
test_class.original_string: StringToObjectConverter converter;
test_class.type: StringToObjectConverter
test_class.var_name: converter
test_class.file: agent/core/src/test/java/org/jolokia/converter/object/StringToObjectConverterTest.java
test_class.identifier: StringToObjectConverterTest
test_case.body: @Test
      public void simpleConversions() {
          Object obj = converter.convertFromString(int.class.getCanonicalName(),"10");
          assertEquals("Int conversion",10,obj);
          obj = converter.convertFromString(Integer.class.getCanonicalName(),"10");
          assertEquals("Integer conversion",10,obj);
          obj = converter.convertFromString(Short.class.getCanonicalName(),"10");
          assertEquals("Short conversion",(short) 10,obj);
          obj = converter.convertFromString(short.class.getCanonicalName(),"10");
          assertEquals("short conversion",Short.parseShort("10"),obj);
          obj = converter.convertFromString(Long.class.getCanonicalName(),"10");
          assertEquals("long conversion",10L,obj);
          obj = converter.convertFromString(long.class.getCanonicalName(),"10");
          assertEquals("Long conversion",10L,obj);
          obj = converter.convertFromString(Byte.class.getCanonicalName(),"10");
          assertEquals("Byte conversion",(byte) 10,obj);
          obj = converter.convertFromString(byte.class.getCanonicalName(),"10");
          assertEquals("byte conversion",Byte.parseByte("10"),obj);
  
          obj = converter.convertFromString(Float.class.getCanonicalName(),"10.5");
          assertEquals("Float conversion",10.5f,obj);
          obj = converter.convertFromString(float.class.getCanonicalName(),"21.3");
          assertEquals("float conversion",new Float(21.3f),obj);
          obj = converter.convertFromString(Double.class.getCanonicalName(),"10.5");
          assertEquals("Double conversion",10.5d,obj);
          obj = converter.convertFromString(double.class.getCanonicalName(),"21.3");
          assertEquals("double conversion",21.3d,obj);
          obj = converter.convertFromString(BigDecimal.class.getCanonicalName(),"83.4e+4");
          assertEquals("BigDecimal conversion", new BigDecimal("8.34e+5"), obj);
          obj = converter.convertFromString(BigInteger.class.getCanonicalName(),"47110815471108154711");
          assertEquals("BigInteger conversion", new BigInteger("47110815471108154711"), obj);
  
          obj = converter.convertFromString(Boolean.class.getCanonicalName(),"false");
          assertEquals("Boolean conversion",false,obj);
          obj = converter.convertFromString(boolean.class.getCanonicalName(),"true");
          assertEquals("boolean conversion",true,obj);
  
          obj = converter.convertFromString(char.class.getCanonicalName(),"a");
          assertEquals("Char conversion",'a',obj);
  
          obj = converter.convertFromString("java.lang.String","10");
          assertEquals("String conversion","10",obj);
      }
test_case.class_method_signature: StringToObjectConverterTest.simpleConversions()
test_case.full_signature: @Test public void simpleConversions()
test_case.identifier: simpleConversions
test_case.invocations: convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals parseShort convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals parseByte convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString getCanonicalName assertEquals convertFromString assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void simpleConversions()
focal_class.declarator: PARSER_MAP = new HashMap<String,Parser>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<String,Parser> PARSER_MAP = new HashMap<String,Parser>();
focal_class.type: Map<String,Parser>
focal_class.var_name: PARSER_MAP
focal_class.declarator: TYPE_SIGNATURE_MAP = new HashMap<String, Class>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<String,Class> TYPE_SIGNATURE_MAP = new HashMap<String, Class>();
focal_class.type: Map<String,Class>
focal_class.var_name: TYPE_SIGNATURE_MAP
focal_class.file: agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java
focal_class.identifier: StringToObjectConverter
focal_class.class_method_signature: StringToObjectConverter.prepareValue(String pExpectedClassName, Object pValue)
focal_class.full_signature: public Object prepareValue(String pExpectedClassName, Object pValue)
focal_class.identifier: prepareValue
focal_class.modifiers: public
focal_class.parameters: (String pExpectedClassName, Object pValue)
focal_class.return: Object
focal_class.signature: Object prepareValue(String pExpectedClassName, Object pValue)
focal_class.class_method_signature: StringToObjectConverter.prepareValue(Class expectedClass, Object pValue)
focal_class.full_signature: private Object prepareValue(Class expectedClass, Object pValue)
focal_class.identifier: prepareValue
focal_class.modifiers: private
focal_class.parameters: (Class expectedClass, Object pValue)
focal_class.return: Object
focal_class.signature: Object prepareValue(Class expectedClass, Object pValue)
focal_class.class_method_signature: StringToObjectConverter.convertSpecialStringTags(String pValue)
focal_class.full_signature: public static String convertSpecialStringTags(String pValue)
focal_class.identifier: convertSpecialStringTags
focal_class.modifiers: public static
focal_class.parameters: (String pValue)
focal_class.return: String
focal_class.signature: String convertSpecialStringTags(String pValue)
focal_class.class_method_signature: StringToObjectConverter.prepareForDirectUsage(Class expectedClass, Object pArgument)
focal_class.full_signature: private Object prepareForDirectUsage(Class expectedClass, Object pArgument)
focal_class.identifier: prepareForDirectUsage
focal_class.modifiers: private
focal_class.parameters: (Class expectedClass, Object pArgument)
focal_class.return: Object
focal_class.signature: Object prepareForDirectUsage(Class expectedClass, Object pArgument)
focal_class.class_method_signature: StringToObjectConverter.convertByConstructor(String pType, String pValue)
focal_class.full_signature: private Object convertByConstructor(String pType, String pValue)
focal_class.identifier: convertByConstructor
focal_class.modifiers: private
focal_class.parameters: (String pType, String pValue)
focal_class.return: Object
focal_class.signature: Object convertByConstructor(String pType, String pValue)
focal_class.class_method_signature: StringToObjectConverter.convertFromString(String pType, String pValue)
focal_class.full_signature: public Object convertFromString(String pType, String pValue)
focal_class.identifier: convertFromString
focal_class.modifiers: public
focal_class.parameters: (String pType, String pValue)
focal_class.return: Object
focal_class.signature: Object convertFromString(String pType, String pValue)
focal_class.class_method_signature: StringToObjectConverter.convertToArray(String pType, String pValue)
focal_class.full_signature: private Object convertToArray(String pType, String pValue)
focal_class.identifier: convertToArray
focal_class.modifiers: private
focal_class.parameters: (String pType, String pValue)
focal_class.return: Object
focal_class.signature: Object convertToArray(String pType, String pValue)
focal_class.class_method_signature: StringToObjectConverter.convertListToArray(Class pType, List pList)
focal_class.full_signature: private Object convertListToArray(Class pType, List pList)
focal_class.identifier: convertListToArray
focal_class.modifiers: private
focal_class.parameters: (Class pType, List pList)
focal_class.return: Object
focal_class.signature: Object convertListToArray(Class pType, List pList)
focal_method.body: public Object convertFromString(String pType, String pValue) {
          String value = convertSpecialStringTags(pValue);
  
          if (value == null) {
              return null;
          }
          if (pType.startsWith("[") && pType.length() >= 2) {
              return convertToArray(pType, value);
          }
  
          Parser parser = PARSER_MAP.get(pType);
          if (parser != null) {
              return parser.extract(value);
          }
          
          Object cValue = convertByConstructor(pType, pValue);
          if (cValue != null) {
          	return cValue;
          }
          
          throw new IllegalArgumentException(
                  "Cannot convert string " + value + " to type " +
                          pType + " because no converter could be found");
      }
focal_method.class_method_signature: StringToObjectConverter.convertFromString(String pType, String pValue)
focal_method.full_signature: public Object convertFromString(String pType, String pValue)
focal_method.identifier: convertFromString
focal_method.invocations: convertSpecialStringTags startsWith length convertToArray get extract convertByConstructor
focal_method.modifiers: public
focal_method.parameters: (String pType, String pValue)
focal_method.return: Object
focal_method.signature: Object convertFromString(String pType, String pValue)