Java 类org.codehaus.jackson.util.TokenBuffer 实例源码

项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected Object handlePolymorphic(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
  throws IOException, JsonProcessingException
{
  JsonDeserializer localJsonDeserializer = _findSubclassDeserializer(paramDeserializationContext, paramObject, paramTokenBuffer);
  if (localJsonDeserializer != null)
  {
    if (paramTokenBuffer != null)
    {
      paramTokenBuffer.writeEndObject();
      JsonParser localJsonParser = paramTokenBuffer.asParser();
      localJsonParser.nextToken();
      paramObject = localJsonDeserializer.deserialize(localJsonParser, paramDeserializationContext, paramObject);
    }
    if (paramJsonParser != null)
      paramObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext, paramObject);
    return paramObject;
  }
  if (paramTokenBuffer != null)
    paramObject = handleUnknownProperties(paramDeserializationContext, paramObject, paramTokenBuffer);
  if (paramJsonParser != null)
    paramObject = deserialize(paramJsonParser, paramDeserializationContext, paramObject);
  return paramObject;
}
项目:12306-android-Decompile    文件:ObjectMapper.java   
protected Object _convert(Object paramObject, JavaType paramJavaType)
  throws IllegalArgumentException
{
  if (paramObject == null)
    return null;
  TokenBuffer localTokenBuffer = new TokenBuffer(this);
  try
  {
    writeValue(localTokenBuffer, paramObject);
    JsonParser localJsonParser = localTokenBuffer.asParser();
    Object localObject = readValue(localJsonParser, paramJavaType);
    localJsonParser.close();
    return localObject;
  }
  catch (IOException localIOException)
  {
  }
  throw new IllegalArgumentException(localIOException.getMessage(), localIOException);
}
项目:12306-android-Decompile    文件:ObjectMapper.java   
public <T extends JsonNode> T valueToTree(Object paramObject)
  throws IllegalArgumentException
{
  if (paramObject == null)
    return null;
  TokenBuffer localTokenBuffer = new TokenBuffer(this);
  try
  {
    writeValue(localTokenBuffer, paramObject);
    JsonParser localJsonParser = localTokenBuffer.asParser();
    JsonNode localJsonNode = readTree(localJsonParser);
    localJsonParser.close();
    return localJsonNode;
  }
  catch (IOException localIOException)
  {
  }
  throw new IllegalArgumentException(localIOException.getMessage(), localIOException);
}
项目:RHome    文件:BeanDeserializer.java   
/**
 * Method called to handle set of one or more unknown properties,
 * stored in their entirety in given {@link TokenBuffer}
 * (as field entries, name and value).
 */
protected Object handleUnknownProperties(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens)
    throws IOException, JsonProcessingException
{
    // First: add closing END_OBJECT as marker
    unknownTokens.writeEndObject();

    // note: buffer does NOT have starting START_OBJECT
    JsonParser bufferParser = unknownTokens.asParser();
    while (bufferParser.nextToken() != JsonToken.END_OBJECT) {
        String propName = bufferParser.getCurrentName();
        // Unknown: let's call handler method
        bufferParser.nextToken();
        handleUnknownProperty(bufferParser, ctxt, bean, propName);
    }
    return bean;
}
项目:RHome    文件:ObjectMapper.java   
protected Object _convert(Object fromValue, JavaType toValueType)
    throws IllegalArgumentException
{
    // sanity check for null first:
    if (fromValue == null) return null;
    /* Then use TokenBuffer, which is a JsonGenerator:
     * (see [JACKSON-175])
     */
    TokenBuffer buf = new TokenBuffer(this);
    try {
        writeValue(buf, fromValue);
        // and provide as with a JsonParser for contents as well!
        JsonParser jp = buf.asParser();
        Object result = readValue(jp, toValueType);
        jp.close();
        return result;
    } catch (IOException e) { // should not occur, no real i/o...
        throw new IllegalArgumentException(e.getMessage(), e);
    }
}
项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected Object handlePolymorphic(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
  throws IOException, JsonProcessingException
{
  JsonDeserializer localJsonDeserializer = _findSubclassDeserializer(paramDeserializationContext, paramObject, paramTokenBuffer);
  if (localJsonDeserializer != null)
  {
    if (paramTokenBuffer != null)
    {
      paramTokenBuffer.writeEndObject();
      JsonParser localJsonParser = paramTokenBuffer.asParser();
      localJsonParser.nextToken();
      paramObject = localJsonDeserializer.deserialize(localJsonParser, paramDeserializationContext, paramObject);
    }
    if (paramJsonParser != null)
      paramObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext, paramObject);
    return paramObject;
  }
  if (paramTokenBuffer != null)
    paramObject = handleUnknownProperties(paramDeserializationContext, paramObject, paramTokenBuffer);
  if (paramJsonParser != null)
    paramObject = deserialize(paramJsonParser, paramDeserializationContext, paramObject);
  return paramObject;
}
项目:12306-android-Decompile    文件:ObjectMapper.java   
protected Object _convert(Object paramObject, JavaType paramJavaType)
  throws IllegalArgumentException
{
  if (paramObject == null)
    return null;
  TokenBuffer localTokenBuffer = new TokenBuffer(this);
  try
  {
    writeValue(localTokenBuffer, paramObject);
    JsonParser localJsonParser = localTokenBuffer.asParser();
    Object localObject = readValue(localJsonParser, paramJavaType);
    localJsonParser.close();
    return localObject;
  }
  catch (IOException localIOException)
  {
  }
  throw new IllegalArgumentException(localIOException.getMessage(), localIOException);
}
项目:12306-android-Decompile    文件:ObjectMapper.java   
public <T extends JsonNode> T valueToTree(Object paramObject)
  throws IllegalArgumentException
{
  if (paramObject == null)
    return null;
  TokenBuffer localTokenBuffer = new TokenBuffer(this);
  try
  {
    writeValue(localTokenBuffer, paramObject);
    JsonParser localJsonParser = localTokenBuffer.asParser();
    JsonNode localJsonNode = readTree(localJsonParser);
    localJsonParser.close();
    return localJsonNode;
  }
  catch (IOException localIOException)
  {
  }
  throw new IllegalArgumentException(localIOException.getMessage(), localIOException);
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected Object handlePolymorphic(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
{
  JsonDeserializer localJsonDeserializer = _findSubclassDeserializer(paramDeserializationContext, paramObject, paramTokenBuffer);
  JsonParser localJsonParser;
  if (localJsonDeserializer != null)
  {
    if (paramTokenBuffer == null)
      break label101;
    paramTokenBuffer.writeEndObject();
    localJsonParser = paramTokenBuffer.asParser();
    localJsonParser.nextToken();
  }
  label101: for (Object localObject = localJsonDeserializer.deserialize(localJsonParser, paramDeserializationContext, paramObject); ; localObject = paramObject)
  {
    if (paramJsonParser != null)
      localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext, localObject);
    while (true)
    {
      return localObject;
      if (paramTokenBuffer != null);
      for (localObject = handleUnknownProperties(paramDeserializationContext, paramObject, paramTokenBuffer); paramJsonParser != null; localObject = paramObject)
        return deserialize(paramJsonParser, paramDeserializationContext, localObject);
    }
  }
}
项目:javalab    文件:JsonUtil.java   
/**
   * Object to Json
   * @throws IOException 
   * @throws JsonMappingException 
   * @throws JsonGenerationException 
   */
  public static String marshallingJson(Object object) {
    try {
          TokenBuffer buffer = new TokenBuffer(null);
          ObjectMapper objectMapper = new ObjectMapper();
          objectMapper.writeValue(buffer, object);
          JsonNode root = objectMapper.readTree(buffer.asParser());
          String jsonText = objectMapper.writeValueAsString(root);
          jsonText = jsonText.replaceAll("null", "\"\"");
          return jsonText;
} catch (IOException e) {
    throw new RuntimeException(e);
}
  }
项目:12306-android-Decompile    文件:StdSerializers.java   
public final void serializeWithType(TokenBuffer paramTokenBuffer, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
  throws IOException, JsonGenerationException
{
  paramTypeSerializer.writeTypePrefixForScalar(paramTokenBuffer, paramJsonGenerator);
  serialize(paramTokenBuffer, paramJsonGenerator, paramSerializerProvider);
  paramTypeSerializer.writeTypeSuffixForScalar(paramTokenBuffer, paramJsonGenerator);
}
项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected Object handleUnknownProperties(DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
  throws IOException, JsonProcessingException
{
  paramTokenBuffer.writeEndObject();
  JsonParser localJsonParser = paramTokenBuffer.asParser();
  while (localJsonParser.nextToken() != JsonToken.END_OBJECT)
  {
    String str = localJsonParser.getCurrentName();
    localJsonParser.nextToken();
    handleUnknownProperty(localJsonParser, paramDeserializationContext, paramObject, str);
  }
  return paramObject;
}
项目:12306-android-Decompile    文件:StdDeserializer.java   
public TokenBuffer deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.copyCurrentStructure(paramJsonParser);
  return localTokenBuffer;
}
项目:RHome    文件:BeanDeserializer.java   
/**
    * Method called in cases where we may have polymorphic deserialization
    * case: that is, type of Creator-constructed bean is not the type
    * of deserializer itself. It should be a sub-class or implementation
    * class; either way, we may have more specific deserializer to use
    * for handling it.
    *
    * @param jp (optional) If not null, parser that has more properties to handle
    *   (in addition to buffered properties); if null, all properties are passed
    *   in buffer
    */
   protected Object handlePolymorphic(JsonParser jp, DeserializationContext ctxt,
                   Object bean, TokenBuffer unknownTokens)
       throws IOException, JsonProcessingException
   {  
       // First things first: maybe there is a more specific deserializer available?
JsonDeserializer<Object> subDeser = _findSubclassDeserializer(ctxt, bean, unknownTokens);
if (subDeser != null) {
    if (unknownTokens != null) {
    // need to add END_OBJECT marker first
    unknownTokens.writeEndObject();
               JsonParser p2 = unknownTokens.asParser();
               p2.nextToken(); // to get to first data field
    bean = subDeser.deserialize(p2, ctxt, bean);
    }
    // Original parser may also have some leftovers
    if (jp != null) {
    bean = subDeser.deserialize(jp, ctxt, bean);
    }
    return bean;
}
// nope; need to use this deserializer. Unknowns we've seen so far?
if (unknownTokens != null) {
    bean = handleUnknownProperties(ctxt, bean, unknownTokens);
}
// and/or things left to process via main parser?
if (jp != null) {
    bean = deserialize(jp, ctxt, bean);
}
return bean;
   }
项目:RHome    文件:BeanDeserializer.java   
/**
 * Helper method called to (try to) locate deserializer for given sub-type of
 * type that this deserializer handles.
 */
protected JsonDeserializer<Object> _findSubclassDeserializer(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens)
    throws IOException, JsonProcessingException
{  
    JsonDeserializer<Object> subDeser;

    // First: maybe we have already created sub-type deserializer?
    synchronized (this) {
        subDeser = (_subDeserializers == null) ? null : _subDeserializers.get(new ClassKey(bean.getClass()));
    }
    if (subDeser != null) {
        return subDeser;
    }
    // If not, maybe we can locate one. First, need provider
    DeserializerProvider deserProv = ctxt.getDeserializerProvider();
    if (deserProv != null) {
        JavaType type = TypeFactory.type(bean.getClass());
        subDeser = deserProv.findValueDeserializer(ctxt.getConfig(), type, null, "*this*");
        // Also, need to cache it
        if (subDeser != null) {
            synchronized (this) {
                if (_subDeserializers == null) {
                    _subDeserializers = new HashMap<ClassKey,JsonDeserializer<Object>>();;
                }
                _subDeserializers.put(new ClassKey(bean.getClass()), subDeser);
            }            
        }
    }
    return subDeser;
}
项目:RHome    文件:StdDeserializer.java   
@Override
public TokenBuffer deserialize(JsonParser jp, DeserializationContext ctxt)
    throws IOException, JsonProcessingException
{
    TokenBuffer tb = new TokenBuffer(jp.getCodec());
    // quite simple, given that TokenBuffer is a JsonGenerator:
    tb.copyCurrentStructure(jp);
    return tb;
}
项目:12306-android-Decompile    文件:StdSerializers.java   
public final void serializeWithType(TokenBuffer paramTokenBuffer, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
  throws IOException, JsonGenerationException
{
  paramTypeSerializer.writeTypePrefixForScalar(paramTokenBuffer, paramJsonGenerator);
  serialize(paramTokenBuffer, paramJsonGenerator, paramSerializerProvider);
  paramTypeSerializer.writeTypeSuffixForScalar(paramTokenBuffer, paramJsonGenerator);
}
项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected Object handleUnknownProperties(DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
  throws IOException, JsonProcessingException
{
  paramTokenBuffer.writeEndObject();
  JsonParser localJsonParser = paramTokenBuffer.asParser();
  while (localJsonParser.nextToken() != JsonToken.END_OBJECT)
  {
    String str = localJsonParser.getCurrentName();
    localJsonParser.nextToken();
    handleUnknownProperty(localJsonParser, paramDeserializationContext, paramObject, str);
  }
  return paramObject;
}
项目:12306-android-Decompile    文件:StdDeserializer.java   
public TokenBuffer deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.copyCurrentStructure(paramJsonParser);
  return localTokenBuffer;
}
项目:ingress-indonesia-dev    文件:AsPropertyTypeDeserializer.java   
protected Object _deserializeTypedUsingDefaultImpl(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, TokenBuffer paramTokenBuffer)
{
  if (this._defaultImpl != null)
  {
    JsonDeserializer localJsonDeserializer = _findDefaultImplDeserializer(paramDeserializationContext);
    if (paramTokenBuffer != null)
    {
      paramTokenBuffer.writeEndObject();
      paramJsonParser = paramTokenBuffer.asParser(paramJsonParser);
      paramJsonParser.nextToken();
    }
    return localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
  }
  throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.FIELD_NAME, "missing property '" + this._typePropertyName + "' that is to contain type id  (for class " + baseTypeName() + ")");
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected JsonDeserializer<Object> _findSubclassDeserializer(DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
{
  Object localObject2;
  try
  {
    if (this._subDeserializers == null);
    for (localObject2 = null; ; localObject2 = (JsonDeserializer)this._subDeserializers.get(new ClassKey(paramObject.getClass())))
    {
      if (localObject2 == null)
        break;
      return localObject2;
    }
  }
  finally
  {
  }
  DeserializerProvider localDeserializerProvider = paramDeserializationContext.getDeserializerProvider();
  if (localDeserializerProvider != null)
  {
    JavaType localJavaType = paramDeserializationContext.constructType(paramObject.getClass());
    localObject2 = localDeserializerProvider.findValueDeserializer(paramDeserializationContext.getConfig(), localJavaType, this._property);
    if (localObject2 != null)
      try
      {
        if (this._subDeserializers == null)
          this._subDeserializers = new HashMap();
        this._subDeserializers.put(new ClassKey(paramObject.getClass()), localObject2);
        return localObject2;
      }
      finally
      {
      }
  }
  return localObject2;
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected Object handleUnknownProperties(DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
{
  paramTokenBuffer.writeEndObject();
  JsonParser localJsonParser = paramTokenBuffer.asParser();
  while (localJsonParser.nextToken() != JsonToken.END_OBJECT)
  {
    String str = localJsonParser.getCurrentName();
    localJsonParser.nextToken();
    handleUnknownProperty(localJsonParser, paramDeserializationContext, paramObject, str);
  }
  return paramObject;
}
项目:ingress-indonesia-dev    文件:ExternalTypeHandler.java   
protected ExternalTypeHandler(ExternalTypeHandler paramExternalTypeHandler)
{
  this._properties = paramExternalTypeHandler._properties;
  this._nameToPropertyIndex = paramExternalTypeHandler._nameToPropertyIndex;
  int i = this._properties.length;
  this._typeIds = new String[i];
  this._tokens = new TokenBuffer[i];
}
项目:ingress-indonesia-dev    文件:ExternalTypeHandler.java   
protected ExternalTypeHandler(ExternalTypeHandler.ExtTypedProperty[] paramArrayOfExtTypedProperty, HashMap<String, Integer> paramHashMap, String[] paramArrayOfString, TokenBuffer[] paramArrayOfTokenBuffer)
{
  this._properties = paramArrayOfExtTypedProperty;
  this._nameToPropertyIndex = paramHashMap;
  this._typeIds = paramArrayOfString;
  this._tokens = paramArrayOfTokenBuffer;
}
项目:ingress-indonesia-dev    文件:ExternalTypeHandler.java   
protected final void _deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, int paramInt)
{
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.writeStartArray();
  localTokenBuffer.writeString(this._typeIds[paramInt]);
  JsonParser localJsonParser1 = this._tokens[paramInt].asParser(paramJsonParser);
  localJsonParser1.nextToken();
  localTokenBuffer.copyCurrentStructure(localJsonParser1);
  localTokenBuffer.writeEndArray();
  JsonParser localJsonParser2 = localTokenBuffer.asParser(paramJsonParser);
  localJsonParser2.nextToken();
  this._properties[paramInt].getProperty().deserializeAndSet(localJsonParser2, paramDeserializationContext, paramObject);
}
项目:ingress-indonesia-dev    文件:ExternalTypeHandler.java   
public boolean handleToken(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, String paramString, Object paramObject)
{
  Integer localInteger = (Integer)this._nameToPropertyIndex.get(paramString);
  if (localInteger == null)
    return false;
  int i = localInteger.intValue();
  int k;
  if (this._properties[i].hasTypePropertyName(paramString))
  {
    this._typeIds[i] = paramJsonParser.getText();
    paramJsonParser.skipChildren();
    if ((paramObject != null) && (this._tokens[i] != null))
      k = 1;
  }
  while (true)
  {
    if (k != 0)
    {
      _deserialize(paramJsonParser, paramDeserializationContext, paramObject, i);
      this._typeIds[i] = null;
      this._tokens[i] = null;
    }
    return true;
    k = 0;
    continue;
    TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
    localTokenBuffer.copyCurrentStructure(paramJsonParser);
    this._tokens[i] = localTokenBuffer;
    int j = 0;
    if (paramObject != null)
    {
      String str = this._typeIds[i];
      j = 0;
      if (str != null)
        j = 1;
    }
    k = j;
  }
}
项目:ingress-indonesia-dev    文件:UnwrappedPropertyHandler.java   
public Object processUnwrapped(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
{
  int i = this._properties.size();
  for (int j = 0; j < i; j++)
  {
    SettableBeanProperty localSettableBeanProperty = (SettableBeanProperty)this._properties.get(j);
    JsonParser localJsonParser = paramTokenBuffer.asParser();
    localJsonParser.nextToken();
    localSettableBeanProperty.deserializeAndSet(localJsonParser, paramDeserializationContext, paramObject);
  }
  return paramObject;
}
项目:12306-android-Decompile    文件:StdSerializers.java   
public void serialize(TokenBuffer paramTokenBuffer, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
  throws IOException, JsonGenerationException
{
  paramTokenBuffer.serialize(paramJsonGenerator);
}
项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected JsonDeserializer<Object> _findSubclassDeserializer(DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
  throws IOException, JsonProcessingException
{
  monitorenter;
  JsonDeserializer localJsonDeserializer;
  try
  {
    if (this._subDeserializers == null);
    for (localJsonDeserializer = null; ; localJsonDeserializer = (JsonDeserializer)this._subDeserializers.get(new ClassKey(paramObject.getClass())))
    {
      monitorexit;
      if (localJsonDeserializer == null)
        break;
      return localJsonDeserializer;
    }
  }
  finally
  {
    monitorexit;
  }
  DeserializerProvider localDeserializerProvider = paramDeserializationContext.getDeserializerProvider();
  if (localDeserializerProvider != null)
  {
    JavaType localJavaType = paramDeserializationContext.constructType(paramObject.getClass());
    localJsonDeserializer = localDeserializerProvider.findValueDeserializer(paramDeserializationContext.getConfig(), localJavaType, this._property);
    if (localJsonDeserializer != null)
    {
      monitorenter;
      try
      {
        if (this._subDeserializers == null)
          this._subDeserializers = new HashMap();
        this._subDeserializers.put(new ClassKey(paramObject.getClass()), localJsonDeserializer);
      }
      finally
      {
        monitorexit;
      }
    }
  }
  return localJsonDeserializer;
}
项目:RHome    文件:StdSerializers.java   
@Override
public void serialize(TokenBuffer value, JsonGenerator jgen, SerializerProvider provider)
    throws IOException, JsonGenerationException
{
    value.serialize(jgen);
}
项目:12306-android-Decompile    文件:StdSerializers.java   
public void serialize(TokenBuffer paramTokenBuffer, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
  throws IOException, JsonGenerationException
{
  paramTokenBuffer.serialize(paramJsonGenerator);
}
项目:12306-android-Decompile    文件:BeanDeserializer.java   
protected JsonDeserializer<Object> _findSubclassDeserializer(DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
  throws IOException, JsonProcessingException
{
  monitorenter;
  JsonDeserializer localJsonDeserializer;
  try
  {
    if (this._subDeserializers == null);
    for (localJsonDeserializer = null; ; localJsonDeserializer = (JsonDeserializer)this._subDeserializers.get(new ClassKey(paramObject.getClass())))
    {
      monitorexit;
      if (localJsonDeserializer == null)
        break;
      return localJsonDeserializer;
    }
  }
  finally
  {
    monitorexit;
  }
  DeserializerProvider localDeserializerProvider = paramDeserializationContext.getDeserializerProvider();
  if (localDeserializerProvider != null)
  {
    JavaType localJavaType = paramDeserializationContext.constructType(paramObject.getClass());
    localJsonDeserializer = localDeserializerProvider.findValueDeserializer(paramDeserializationContext.getConfig(), localJavaType, this._property);
    if (localJsonDeserializer != null)
    {
      monitorenter;
      try
      {
        if (this._subDeserializers == null)
          this._subDeserializers = new HashMap();
        this._subDeserializers.put(new ClassKey(paramObject.getClass()), localJsonDeserializer);
      }
      finally
      {
        monitorexit;
      }
    }
  }
  return localJsonDeserializer;
}
项目:ingress-indonesia-dev    文件:TokenBufferSerializer.java   
public TokenBufferSerializer()
{
  super(TokenBuffer.class);
}
项目:ingress-indonesia-dev    文件:TokenBufferSerializer.java   
public void serialize(TokenBuffer paramTokenBuffer, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
{
  paramTokenBuffer.serialize(paramJsonGenerator);
}
项目:ingress-indonesia-dev    文件:TokenBufferSerializer.java   
public final void serializeWithType(TokenBuffer paramTokenBuffer, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
{
  paramTypeSerializer.writeTypePrefixForScalar(paramTokenBuffer, paramJsonGenerator);
  serialize(paramTokenBuffer, paramJsonGenerator, paramSerializerProvider);
  paramTypeSerializer.writeTypeSuffixForScalar(paramTokenBuffer, paramJsonGenerator);
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected Object deserializeUsingPropertyBasedWithExternalTypeId(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
  ExternalTypeHandler localExternalTypeHandler = this._externalTypeIdHandler.start();
  PropertyBasedCreator localPropertyBasedCreator = this._propertyBasedCreator;
  PropertyValueBuffer localPropertyValueBuffer = localPropertyBasedCreator.startBuilding(paramJsonParser, paramDeserializationContext);
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.writeStartObject();
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  if (localJsonToken1 == JsonToken.FIELD_NAME)
  {
    String str = paramJsonParser.getCurrentName();
    paramJsonParser.nextToken();
    SettableBeanProperty localSettableBeanProperty1 = localPropertyBasedCreator.findCreatorProperty(str);
    Object localObject3;
    if (localSettableBeanProperty1 != null)
    {
      Object localObject2 = localSettableBeanProperty1.deserialize(paramJsonParser, paramDeserializationContext);
      if (localPropertyValueBuffer.assignParameter(localSettableBeanProperty1.getPropertyIndex(), localObject2))
      {
        JsonToken localJsonToken2 = paramJsonParser.nextToken();
        try
        {
          localObject3 = localPropertyBasedCreator.build(localPropertyValueBuffer);
          while (localJsonToken2 == JsonToken.FIELD_NAME)
          {
            paramJsonParser.nextToken();
            localTokenBuffer.copyCurrentStructure(paramJsonParser);
            localJsonToken2 = paramJsonParser.nextToken();
          }
        }
        catch (Exception localException2)
        {
          wrapAndThrow(localException2, this._beanType.getRawClass(), str, paramDeserializationContext);
        }
      }
    }
    while (true)
    {
      localJsonToken1 = paramJsonParser.nextToken();
      break;
      if (localObject3.getClass() != this._beanType.getRawClass())
        throw paramDeserializationContext.mappingException("Can not create polymorphic instances with unwrapped values");
      return localExternalTypeHandler.complete(paramJsonParser, paramDeserializationContext, localObject3);
      SettableBeanProperty localSettableBeanProperty2 = this._beanProperties.find(str);
      if (localSettableBeanProperty2 != null)
        localPropertyValueBuffer.bufferProperty(localSettableBeanProperty2, localSettableBeanProperty2.deserialize(paramJsonParser, paramDeserializationContext));
      else if (!localExternalTypeHandler.handleToken(paramJsonParser, paramDeserializationContext, str, null))
        if ((this._ignorableProps != null) && (this._ignorableProps.contains(str)))
          paramJsonParser.skipChildren();
        else if (this._anySetter != null)
          localPropertyValueBuffer.bufferAnyProperty(this._anySetter, str, this._anySetter.deserialize(paramJsonParser, paramDeserializationContext));
    }
  }
  try
  {
    Object localObject1 = localPropertyBasedCreator.build(localPropertyValueBuffer);
    return localExternalTypeHandler.complete(paramJsonParser, paramDeserializationContext, localObject1);
  }
  catch (Exception localException1)
  {
    wrapInstantiationProblem(localException1, paramDeserializationContext);
  }
  return null;
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
  PropertyBasedCreator localPropertyBasedCreator = this._propertyBasedCreator;
  PropertyValueBuffer localPropertyValueBuffer = localPropertyBasedCreator.startBuilding(paramJsonParser, paramDeserializationContext);
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.writeStartObject();
  JsonToken localJsonToken1 = paramJsonParser.getCurrentToken();
  if (localJsonToken1 == JsonToken.FIELD_NAME)
  {
    String str = paramJsonParser.getCurrentName();
    paramJsonParser.nextToken();
    SettableBeanProperty localSettableBeanProperty1 = localPropertyBasedCreator.findCreatorProperty(str);
    Object localObject3;
    if (localSettableBeanProperty1 != null)
    {
      Object localObject2 = localSettableBeanProperty1.deserialize(paramJsonParser, paramDeserializationContext);
      if (localPropertyValueBuffer.assignParameter(localSettableBeanProperty1.getPropertyIndex(), localObject2))
      {
        JsonToken localJsonToken2 = paramJsonParser.nextToken();
        try
        {
          localObject3 = localPropertyBasedCreator.build(localPropertyValueBuffer);
          while (localJsonToken2 == JsonToken.FIELD_NAME)
          {
            paramJsonParser.nextToken();
            localTokenBuffer.copyCurrentStructure(paramJsonParser);
            localJsonToken2 = paramJsonParser.nextToken();
          }
        }
        catch (Exception localException2)
        {
          wrapAndThrow(localException2, this._beanType.getRawClass(), str, paramDeserializationContext);
        }
      }
    }
    while (true)
    {
      localJsonToken1 = paramJsonParser.nextToken();
      break;
      localTokenBuffer.writeEndObject();
      if (localObject3.getClass() != this._beanType.getRawClass())
        throw paramDeserializationContext.mappingException("Can not create polymorphic instances with unwrapped values");
      return this._unwrappedPropertyHandler.processUnwrapped(paramJsonParser, paramDeserializationContext, localObject3, localTokenBuffer);
      SettableBeanProperty localSettableBeanProperty2 = this._beanProperties.find(str);
      if (localSettableBeanProperty2 != null)
      {
        localPropertyValueBuffer.bufferProperty(localSettableBeanProperty2, localSettableBeanProperty2.deserialize(paramJsonParser, paramDeserializationContext));
      }
      else if ((this._ignorableProps != null) && (this._ignorableProps.contains(str)))
      {
        paramJsonParser.skipChildren();
      }
      else
      {
        localTokenBuffer.writeFieldName(str);
        localTokenBuffer.copyCurrentStructure(paramJsonParser);
        if (this._anySetter != null)
          localPropertyValueBuffer.bufferAnyProperty(this._anySetter, str, this._anySetter.deserialize(paramJsonParser, paramDeserializationContext));
      }
    }
  }
  try
  {
    Object localObject1 = localPropertyBasedCreator.build(localPropertyValueBuffer);
    return this._unwrappedPropertyHandler.processUnwrapped(paramJsonParser, paramDeserializationContext, localObject1, localTokenBuffer);
  }
  catch (Exception localException1)
  {
    wrapInstantiationProblem(localException1, paramDeserializationContext);
  }
  return null;
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected Object deserializeWithUnwrapped(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
  if (this._delegateDeserializer != null)
    return this._valueInstantiator.createUsingDelegate(this._delegateDeserializer.deserialize(paramJsonParser, paramDeserializationContext));
  if (this._propertyBasedCreator != null)
    return deserializeUsingPropertyBasedWithUnwrapped(paramJsonParser, paramDeserializationContext);
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.writeStartObject();
  Object localObject = this._valueInstantiator.createUsingDefault();
  if (this._injectables != null)
    injectValues(paramDeserializationContext, localObject);
  if (paramJsonParser.getCurrentToken() != JsonToken.END_OBJECT)
  {
    String str = paramJsonParser.getCurrentName();
    paramJsonParser.nextToken();
    SettableBeanProperty localSettableBeanProperty = this._beanProperties.find(str);
    if (localSettableBeanProperty != null);
    while (true)
    {
      try
      {
        localSettableBeanProperty.deserializeAndSet(paramJsonParser, paramDeserializationContext, localObject);
        paramJsonParser.nextToken();
      }
      catch (Exception localException2)
      {
        wrapAndThrow(localException2, localObject, str, paramDeserializationContext);
        continue;
      }
      if ((this._ignorableProps != null) && (this._ignorableProps.contains(str)))
      {
        paramJsonParser.skipChildren();
      }
      else
      {
        localTokenBuffer.writeFieldName(str);
        localTokenBuffer.copyCurrentStructure(paramJsonParser);
        if (this._anySetter != null)
          try
          {
            this._anySetter.deserializeAndSet(paramJsonParser, paramDeserializationContext, localObject, str);
          }
          catch (Exception localException1)
          {
            wrapAndThrow(localException1, localObject, str, paramDeserializationContext);
          }
      }
    }
  }
  localTokenBuffer.writeEndObject();
  this._unwrappedPropertyHandler.processUnwrapped(paramJsonParser, paramDeserializationContext, localObject, localTokenBuffer);
  return localObject;
}
项目:ingress-indonesia-dev    文件:BeanDeserializer.java   
protected Object deserializeWithUnwrapped(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject)
{
  JsonToken localJsonToken = paramJsonParser.getCurrentToken();
  if (localJsonToken == JsonToken.START_OBJECT)
    localJsonToken = paramJsonParser.nextToken();
  TokenBuffer localTokenBuffer = new TokenBuffer(paramJsonParser.getCodec());
  localTokenBuffer.writeStartObject();
  if (localJsonToken == JsonToken.FIELD_NAME)
  {
    String str = paramJsonParser.getCurrentName();
    SettableBeanProperty localSettableBeanProperty = this._beanProperties.find(str);
    paramJsonParser.nextToken();
    if (localSettableBeanProperty != null);
    while (true)
    {
      try
      {
        localSettableBeanProperty.deserializeAndSet(paramJsonParser, paramDeserializationContext, paramObject);
        localJsonToken = paramJsonParser.nextToken();
      }
      catch (Exception localException)
      {
        wrapAndThrow(localException, paramObject, str, paramDeserializationContext);
        continue;
      }
      if ((this._ignorableProps != null) && (this._ignorableProps.contains(str)))
      {
        paramJsonParser.skipChildren();
      }
      else
      {
        localTokenBuffer.writeFieldName(str);
        localTokenBuffer.copyCurrentStructure(paramJsonParser);
        if (this._anySetter != null)
          this._anySetter.deserializeAndSet(paramJsonParser, paramDeserializationContext, paramObject, str);
      }
    }
  }
  localTokenBuffer.writeEndObject();
  this._unwrappedPropertyHandler.processUnwrapped(paramJsonParser, paramDeserializationContext, paramObject, localTokenBuffer);
  return paramObject;
}
项目:ingress-indonesia-dev    文件:TokenBufferDeserializer.java   
public TokenBufferDeserializer()
{
  super(TokenBuffer.class);
}