public static Object parsePrimitive ( final String fieldName , final PrimitiveAttribute < ? > pAtt , final PObject requestData ) { Class < ? > valueClass = pAtt . getValueClass ( ) ; Object value ; try { value = parseValue ( false , new String [ 0 ] , valueClass , fieldName , requestData ) ; } catch ( UnsupportedTypeException e ) { String type = e . type . getName ( ) ; if ( e . type . isArray ( ) ) { type = e . type . getComponentType ( ) . getName ( ) + "[]" ; } throw new RuntimeException ( "The type '" + type + "' is not a supported type when parsing json. " + "See documentation for supported types.\n\nUnsupported type found in attribute " + fieldName + "\n\nTo support more types add the type to " + "parseValue and parseArrayValue in this class and add a test to the test class" , e ) ; } pAtt . validateValue ( value ) ; return value ; }
Get the value of a primitive type from the request data .