public T deserialize(
     JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
     throws IOException {
   Object localObject;
   String str;
   if ((paramJsonParser.getCurrentToken() == JsonToken.START_ARRAY)
       && (paramDeserializationContext.isEnabled(
           DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS))) {
     paramJsonParser.nextToken();
     localObject = deserialize(paramJsonParser, paramDeserializationContext);
     if (paramJsonParser.nextToken() != JsonToken.END_ARRAY) {
       throw paramDeserializationContext.wrongTokenException(
           paramJsonParser,
           JsonToken.END_ARRAY,
           "Attempted to unwrap single value array for single '"
               + this._valueClass.getName()
               + "' value but there was more than a single value in the array");
     }
   } else {
     localObject = paramJsonParser.getValueAsString();
     if (localObject == null) {
       break label194;
     }
     if (((String) localObject).length() != 0) {
       str = ((String) localObject).trim();
       if (str.length() != 0) {
         break label118;
       }
     }
     localObject = _deserializeFromEmptyString();
   }
   return (T) localObject;
   label118:
   paramJsonParser = null;
   try {
     localObject = _deserialize(str, paramDeserializationContext);
     if (localObject != null) {
       return (T) localObject;
     }
   } catch (IllegalArgumentException paramJsonParser) {
     localObject = "not a valid textual representation";
     if (paramJsonParser != null) {
       localObject =
           "not a valid textual representation" + "problem: " + paramJsonParser.getMessage();
     }
     paramDeserializationContext =
         paramDeserializationContext.weirdStringException(
             str, this._valueClass, (String) localObject);
     if (paramJsonParser != null) {
       paramDeserializationContext.initCause(paramJsonParser);
     }
     throw paramDeserializationContext;
   }
   label194:
   if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_EMBEDDED_OBJECT) {
     paramJsonParser = paramJsonParser.getEmbeddedObject();
     if (paramJsonParser == null) {
       return null;
     }
     if (this._valueClass.isAssignableFrom(paramJsonParser.getClass())) {
       return paramJsonParser;
     }
     return (T) _deserializeEmbedded(paramJsonParser, paramDeserializationContext);
   }
   throw paramDeserializationContext.mappingException(this._valueClass);
 }
Ejemplo n.º 2
0
 private ByteQuadsCanonicalizer _findSymbols(JsonParser p) throws Exception {
   Field syms = p.getClass().getDeclaredField("_symbols");
   syms.setAccessible(true);
   return ((ByteQuadsCanonicalizer) syms.get(p));
 }